Esempio n. 1
0
        public void GetVersion()
        {
            var target = new MSBuildLocator(new FileSystem());

            var latest = target.GetLatest();
            var actual = target.GetVersion(latest.Version);

            Assert.NotNull(actual);
            Assert.Equal(latest.Version, actual.Version);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
 private StartMSBuildCmdlets(IFileSystem fileSystem)
     : base(fileSystem)
 {
     Require.NotNull(fileSystem, nameof(fileSystem));
     _msBuildLocator = new MSBuildLocator(fileSystem);
 }