Exemple #1
0
        public void ParseInputAsTime(string text, int expectedHours, int expectedMins)
        {
            b.Info.Flow();

            var sut    = new TalkingClockSupport(ConverterChainBase.GetFullChain());
            var result = sut.ParseTime(text);

            Assert.Equal(expectedMins, result.Minute);
            Assert.Equal(expectedHours, result.Hour);
        }
Exemple #2
0
        public void BadParsesThrowException(string input)
        {
            b.Info.Flow();

            var sut = new TalkingClockSupport(ConverterChainBase.GetFullChain());

            Assert.Throws <ArgumentOutOfRangeException>(() => {
                _ = sut.ParseTime(input);
            });
        }
Exemple #3
0
        public void FullUseCasesWork(int hour, int minute, string expected)
        {
            b.Info.Flow($"{hour}:{minute} -> {expected}");

            var    sut   = new TalkingClockSupport(ConverterChainBase.GetFullChain());
            var    st    = new SmallTimeRenderer(new SmallTime(hour, minute));
            string reply = sut.ConvertTime(st);

            b.Verbose.Log($"E[{expected}] A[{reply}]");
            Assert.Contains(expected, reply);
        }