public void GetInvalidWorkedHours(string workedHours) { var writeLine = new Action <string>(message => { }); var readLine = new Func <string>(() => workedHours); var command = new GetWorkedHoursCommand(writeLine, readLine); Assert.Throws <ArgumentException>(() => command.Handle()); }
public void GetValidWorkedHours(string workedHours) { var writeLine = new Action <string>(message => { }); var readLine = new Func <string>(() => workedHours); var command = new GetWorkedHoursCommand(writeLine, readLine); var result = command.Handle(); Assert.Equal(int.Parse(workedHours), result); }
private static int GetWorkedHours() { var command = new GetWorkedHoursCommand(Console.WriteLine, Console.ReadLine); return(command.Handle()); }