public void BuildsOutputFileOfFirstProject()
        {
            UnzipTestSolution();

            var solution = new VisualStudioSolution { SolutionPath = new ImmediateValue<string>(Path.Combine(SolutionUnzipDirectory, @"TestSolution\TestSolution.sln")) };

            solution.Build();

            Assert.That(File.Exists(solution.Projects["TestSolution"].OutputFile.Value));
        }
Esempio n. 2
0
        public void BuildIfConfigurationValueIsSetToNull()
        {
            // arrange
            var bounceMock = new Mock<IBounce>() { DefaultValue = Moq.DefaultValue.Mock };
            var shellMock = new Mock<IShellCommandExecutor>();
            var solution = new VisualStudioSolution { SolutionPath = new ImmediateValue<string>(@"TestSolution.sln"), Configuration = new ImmediateValue<string>(null) };

            bounceMock.SetupAllProperties();
            bounceMock.SetupGet(_ => _.ShellCommand).Returns(shellMock.Object);

            // act
            solution.Build(bounceMock.Object);

            // assert
            shellMock.Verify(_ => _.ExecuteAndExpectSuccess(It.IsAny<string>(), It.Is<string>(s => s.Satisfy(v => v == "\"TestSolution.sln\""))));
        }
Esempio n. 3
0
        public void BuildIfConfigurationIsSetToNull()
        {
            // arrange
            var bounceMock = new Mock <IBounce>()
            {
                DefaultValue = Moq.DefaultValue.Mock
            };
            var shellMock = new Mock <IShellCommandExecutor>();
            var solution  = new VisualStudioSolution {
                SolutionPath = new ImmediateValue <string>(@"TestSolution.sln"), Configuration = null
            };

            bounceMock.SetupAllProperties();
            bounceMock.SetupGet(_ => _.ShellCommand).Returns(shellMock.Object);

            // act
            solution.Build(bounceMock.Object);

            // assert
            shellMock.Verify(_ => _.ExecuteAndExpectSuccess(It.IsAny <string>(), It.Is <string>(s => s.Satisfy(v => v == "\"TestSolution.sln\""))));
        }
Esempio n. 4
0
        public void BuildWithOutdirOptionEnsureThatLastSlashIsSet()
        {
            // arrange
            var bounceMock = new Mock <IBounce>()
            {
                DefaultValue = Moq.DefaultValue.Mock
            };
            var shellMock = new Mock <IShellCommandExecutor>();
            var solution  = new VisualStudioSolution {
                SolutionPath = new ImmediateValue <string>(@"TestSolution.sln"), OutputDir = "..\\Build"
            };

            bounceMock.SetupAllProperties();
            bounceMock.SetupGet(_ => _.ShellCommand).Returns(shellMock.Object);

            // act
            solution.Build(bounceMock.Object);

            // assert
            shellMock.Verify(_ => _.ExecuteAndExpectSuccess(It.IsAny <string>(), It.Is <string>(s => s.Satisfy(v => v == "\"TestSolution.sln\" /p:Outdir=..\\Build\\"))));
        }
Esempio n. 5
0
        public void BuildWithOutdirOptionEnsureThatLastSlashIsSet()
        {
            // arrange
            var bounceMock = new Mock<IBounce>() { DefaultValue = Moq.DefaultValue.Mock };
            var shellMock = new Mock<IShellCommandExecutor>();
            var solution = new VisualStudioSolution { SolutionPath = new ImmediateValue<string>(@"TestSolution.sln"), OutputDir = "..\\Build" };

            bounceMock.SetupAllProperties();
            bounceMock.SetupGet(_ => _.ShellCommand).Returns(shellMock.Object);

            // act
            solution.Build(bounceMock.Object);

            // assert
            shellMock.Verify(_ => _.ExecuteAndExpectSuccess(It.IsAny<string>(), It.Is<string>(s => s.Satisfy(v => v == "\"TestSolution.sln\" /p:Outdir=..\\Build\\"))));
        }