public void GetAll64_FilesDoNotExist_ShouldDiscardThem() { var fileSystem = new Mock<IFileSystem>(); fileSystem.Setup(fs => fs.FileExists(It.IsAny<string>())).Returns(false); var target = new MSBuildLocator(fileSystem.Object); var actual = target.GetAll64(); Assert.Empty(actual); }
public void GetLatest() { var target = new MSBuildLocator(new FileSystem()); var actual = target.GetLatest(); Assert.NotNull(actual); foreach(var msBuild in target.GetAll64()) Assert.InRange(msBuild.Version, new Version(), actual.Version); }
public void GetAll64_ShouldFindAtLeastOne() { var target = new MSBuildLocator(new FileSystem()); var actual = target.GetAll64(); // Assumes current machine has at least 1 MSBuild installed Assert.NotEmpty(actual); foreach (var msBuild in actual) Assert.True(File.Exists(msBuild.Path)); }