-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeamCityContextTests.cs
65 lines (50 loc) · 1.67 KB
/
TeamCityContextTests.cs
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// ReSharper disable InconsistentNaming
namespace CSharpInteractive.Tests;
public class TeamCityContextTests
{
private readonly Mock<IEnvironment> _environment = new();
private readonly Mock<IDotNetEnvironment> _dotnetEnvironment = new();
private readonly Mock<ICISettings> _teamCitySettings = new();
[Fact]
public void ShouldGetDotNetExecutablePath()
{
// Given
var settings = CreateInstance();
// When
_dotnetEnvironment.SetupGet(i => i.Path).Returns("Bin");
// Then
settings.DotNetExecutablePath.ShouldBe("Bin");
}
[Fact]
public void ShouldGetDotNetMSBuildLoggerDirectory()
{
// Given
var settings = CreateInstance();
// When
_environment.Setup(i => i.GetPath(SpecialFolder.Bin)).Returns("Bin");
// Then
settings.DotNetMSBuildLoggerDirectory.ShouldBe(Path.Combine("Bin", "msbuild"));
}
[Fact]
public void ShouldGetDotNetVSTestLoggerDirectory()
{
// Given
var settings = CreateInstance();
// When
_environment.Setup(i => i.GetPath(SpecialFolder.Bin)).Returns("Bin");
// Then
settings.DotNetVSTestLoggerDirectory.ShouldBe(Path.Combine("Bin", "vstest"));
}
[Fact]
public void ShouldGetTeamCityMessagesPath()
{
// Given
var resolver = CreateInstance();
// When
_teamCitySettings.SetupGet(i => i.ServiceMessagesPath).Returns("Tmp");
// Then
resolver.TeamCityMessagesPath.ShouldBe("Tmp");
}
private TeamCityContext CreateInstance() =>
new(_environment.Object, _dotnetEnvironment.Object, _teamCitySettings.Object);
}