-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPathTests.cs
More file actions
48 lines (37 loc) · 1.38 KB
/
Copy pathPathTests.cs
File metadata and controls
48 lines (37 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Linq;
using System.Threading.Tasks;
using JavaVersionSwitcher.Adapters;
using Shouldly;
using Xunit;
namespace JavaVersionSwitcher.Tests;
public class PathTests
{
private readonly PathAdapter _adapter = new PathAdapter();
[Fact]
public async Task Can_Set_per_process()
{
var expected = new []{ Guid.NewGuid().ToString("d") };
await _adapter.SetValue(expected, EnvironmentScope.Process);
var actual = await _adapter.GetValue(EnvironmentScope.Process);
actual.ShouldBe(expected);
}
[Fact]
public async Task Set_per_process_does_not_modify_user()
{
var modified = (await _adapter.GetValue(EnvironmentScope.User)).ToList();
modified.Add(Guid.NewGuid().ToString("d"));
await _adapter.SetValue(modified, EnvironmentScope.Process);
var actual = await _adapter.GetValue(EnvironmentScope.User);
actual.Count().ShouldBe(modified.Count - 1);
}
[Fact]
public async Task Set_per_process_does_not_modify_machine()
{
var modified = (await _adapter.GetValue(EnvironmentScope.Machine)).ToList();
modified.Add(Guid.NewGuid().ToString("d"));
await _adapter.SetValue(modified, EnvironmentScope.Process);
var actual = await _adapter.GetValue(EnvironmentScope.Machine);
actual.Count().ShouldBe(modified.Count - 1);
}
}