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

            return(command.Handle());
        }