Beispiel #1
0
        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());
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        private static int GetWorkedHours()
        {
            var command = new GetWorkedHoursCommand(Console.WriteLine, Console.ReadLine);

            return(command.Handle());
        }