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

            return(command.Handle());
        }