public void Given_WrongSecondArgument_Then_ProgramWritesErrorMessage(string firstArgument, string secondArgument) { var memory = new MemoryWriter(); var program = TestUtils.CreateTestProgram(memory); program.Run(new[] { firstArgument, secondArgument }); Assert.AreEqual(TestUtils.GetCannotParseMessage(secondArgument), memory.ReadLast()); }
public void Given_CorruptedData_Then_ProgramWritesCorrectMessage(string firstArgument, string secondArgument) { var memory = new MemoryWriter(); var program = TestUtils.CreateTestProgram(memory); program.Run(new[] { firstArgument, secondArgument }); Assert.AreEqual(TestUtils.GetUnexpectedErrorMessage(), memory.ReadLast()); }
public void Given_WrongParameterCount_Then_ProgramWritesErrorMessage(int count) { var memory = new MemoryWriter(); var program = TestUtils.CreateTestProgram(memory); var parameters = TestDataSources.StringEmitter().Take(count).ToArray(); program.Run(parameters); Assert.AreEqual(TestUtils.GetWrongCountMessage(count), memory.ReadLast()); }
public void Given_StartDateBefore_Then_ProgramWritesErrorMessage(string firstArgument, string secondArgument, string expectedOutput) { var memory = new MemoryWriter(); var program = TestUtils.CreateTestProgram(memory); program.Run(new[] { firstArgument, secondArgument }); Assert.AreEqual(expectedOutput, memory.ReadLast()); }
public void Given_HappyCases_Then_ProgramWritesCorrectInterval(string firstArgument, string secondArgument, string expectedOutput) { var memory = new MemoryWriter(); var program = TestUtils.CreateTestProgram(memory); program.Run(new[] { firstArgument, secondArgument }); Assert.AreEqual(expectedOutput, memory.ReadLast()); }