public void test_big_ticket([Values(81, 110)] int speed) { string ticket = SpeedingIfElse.IssueSpeedTicket(speed); //Console.WriteLine("input = {0} , output = {1} ", speed, ticket); Assert.AreEqual("Big ticket", ticket); }
public void test_no_ticket([Values(0, 40, 50, 60, -40)] int speed) { string ticket = SpeedingIfElse.IssueSpeedTicket(speed); //Console.WriteLine("input = {0} , output = {1} ", speed, ticket); Assert.AreEqual("No ticket", ticket); }
public void test_small_ticket([Values(61, 79, 80)] int speed) { string ticket = SpeedingIfElse.IssueSpeedTicket(speed); //Console.WriteLine("input = {0} , output = {1} ", speed, ticket); Assert.AreEqual("Small ticket", ticket); }
static void Main(string[] args) { /* * string result = SpeedingIfElse.IssueSpeedTicket(100); * Console.WriteLine(result); * Console.ReadLine(); */ //TDD Phase int speed; string ticket; speed = 0; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); speed = 50; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); speed = 60; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); speed = 61; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); speed = 79; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); speed = 80; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); speed = 81; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); speed = -49; ticket = SpeedingIfElse.IssueSpeedTicket(speed); Console.WriteLine("input = {0} , output = {1} ", speed, ticket); }