public void Should_Return_Provided_Process_Runner() { // Given var fixture = new CakeContextFixture(); var context = fixture.CreateContext(); // When var processRunner = context.ProcessRunner; // Then Assert.Same(fixture.ProcessRunner, processRunner); }
public void Should_Return_Provided_Arguments() { // Given var fixture = new CakeContextFixture(); var context = fixture.CreateContext(); // When var arguments = context.Arguments; // Then Assert.Same(fixture.Arguments, arguments); }
public void Should_Return_Provided_Log() { // Given var fixture = new CakeContextFixture(); var context = fixture.CreateContext(); // When var log = context.Log; // Then Assert.Same(fixture.Log, log); }
public void Should_Return_Provided_Globber() { // Given var fixture = new CakeContextFixture(); var context = fixture.CreateContext(); // When var globber = context.Globber; // Then Assert.Same(fixture.Globber, globber); }
public void Should_Return_Provided_Environment() { // Given var fixture = new CakeContextFixture(); var context = fixture.CreateContext(); // When var environment = context.Environment; // Then Assert.Same(fixture.Environment, environment); }
public void Should_Return_Provided_File_System() { // Given var fixture = new CakeContextFixture(); var context = fixture.CreateContext(); // When var fileSystem = context.FileSystem; // Then Assert.Same(fixture.FileSystem, fileSystem); }
public void Should_Throw_If_Process_Runner_Is_Null() { // Given var fixture = new CakeContextFixture(); fixture.ProcessRunner = null; // When var result = Record.Exception(() => fixture.CreateContext()); // Then Assert.IsArgumentNullException(result, "processRunner"); }
public void Should_Throw_If_Arguments_Are_Null() { // Given var fixture = new CakeContextFixture(); fixture.Arguments = null; // When var result = Record.Exception(() => fixture.CreateContext()); // Then Assert.IsArgumentNullException(result, "arguments"); }
public void Should_Throw_If_Environment_Is_Null() { // Given var fixture = new CakeContextFixture(); fixture.Environment = null; // When var result = Record.Exception(() => fixture.CreateContext()); // Then Assert.IsArgumentNullException(result, "environment"); }
public void Should_Throw_If_File_System_Is_Null() { // Given var fixture = new CakeContextFixture(); fixture.FileSystem = null; // When var result = Record.Exception(() => fixture.CreateContext()); // Then Assert.IsArgumentNullException(result, "fileSystem"); }
public void Should_Throw_If_Resolver_Could_Not_Be_Found() { // Given var fixture = new CakeContextFixture(); var context = fixture.CreateContext(); // When var result = Record.Exception(() => context.GetToolResolver("Foo")); // Then Assert.IsType <CakeException>(result); Assert.Equal("Failed to resolve tool: Foo", result.Message); }
public void Should_Throw_If_Log_Is_Null() { // Given var fixture = new CakeContextFixture(); fixture.Log = null; // When var result = Record.Exception(() => fixture.CreateContext()); // Then AssertEx.IsArgumentNullException(result, "log"); }
public void Should_Find_Tool_By_Name_Regardless_Of_Casing(string name) { // Given var fixture = new CakeContextFixture(); var resolver = Substitute.For <IToolResolver>(); resolver.Name.Returns("Foo"); fixture.ToolResolvers.Add(resolver); var context = fixture.CreateContext(); // When var result = context.GetToolResolver(name); // Then Assert.Equal(resolver, result); }