Esempio n. 1
0
        public void _02_Creer_une_classe_ClockService_qui_renvoit_la_date_courante()
        {
            ClockService clockService = new ClockService();

            Assert.NotNull(clockService);

            DateTime now = clockService.Now();
        }
Esempio n. 2
0
        public void _04_Creer_une_interface_IClockService_pour_unifier_MockClockService_et_ClockService()
        {
            IClockService clockService;
            DateTime?     now;

            clockService = new ClockService();

            Assert.NotNull(clockService);

            now = clockService.Now();

            Assert.NotNull(now);

            clockService = new MockClockService(DateTime.Now);

            Assert.NotNull(clockService);

            now = clockService.Now();

            Assert.NotNull(now);
        }