public void ShouldReturnString(string input, string output)
        {
            Mock <ITimeParser> timeParserMock = new Mock <ITimeParser>();

            timeParserMock.Setup(mock => mock.ParseTimeString(input)).Returns(TimeSpan.Parse(input));

            IBerlinClockParser parser = new BerlinClockParser(timeParserMock.Object);

            string actual = parser.getBerlinTime(input);

            Assert.Equal(output, actual);
        }
示例#2
0
        static int Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine(usageText);

                return(1);
            }

            IBerlinClockParser clockParser = new BerlinClockParser(new TimeParser());

            Console.WriteLine(clockParser.getBerlinTime(args[0]));

            return(0);
        }