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

            return(command.Handle());
        }