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)); }
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\"")))); }
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\"")))); }
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\\")))); }
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\\")))); }