public void ShouldThrowIfAppPathDoesNotExist([Frozen] IAdvProcessRunner runner, IFileSystem fileSystem, AppPathBasedIISExpressRunner sut) { var settings = new AppPathBasedIISExpressSettings(@"c:\MyApp"); fileSystem.Exist(settings.AppPath).Returns(false); sut.Invoking(s => s.StartServer(settings)).ShouldThrow <CakeException>(); runner.DidNotReceiveWithAnyArgs() .Start(null, null); }
public void ShouldThrowWhenConfigFileDoesNotExist([Frozen] ICakeEnvironment environment, IFileSystem fileSystem, [Frozen] IAdvProcessRunner runner, ConfigBasedIISExpressRunner sut) { environment.WorkingDirectory.Returns("c:/MyWorkingDirectory"); var settings = new ConfigBasedIISExpressSettings { ConfigFilePath = FilePath.FromString(@"c:\someOtherDirectory\applicationhost.config") }; fileSystem.Exist( Arg.Is <FilePath>( f => f.FullPath.Equals(settings.ConfigFilePath.FullPath, StringComparison.OrdinalIgnoreCase))).Returns(false); sut.Invoking(s => s.StartServer(settings)).ShouldThrow <CakeException>(); runner.DidNotReceiveWithAnyArgs().Start(null, null); }