Пример #1
0
        public void SucessIfStartBeforeFinish()
        {
            var consult = new Consult
            {
                id              = 9999999,
                consultStartAt  = new DateTime(2019, 6, 18, 12, 0, 0),
                consultFinishAt = new DateTime(2019, 6, 18, 13, 0, 0)
            };

            var consultValidation = new ConsultValidation();

            var idReturned = consultValidation.validStartBeforeFinish(consult);

            Assert.Equal(consult.id, idReturned);
        }
Пример #2
0
        public void ErrorIfStartAfterFinish()
        {
            var consult = new Consult
            {
                id              = 9999999,
                consultStartAt  = new DateTime(2019, 6, 18, 13, 0, 0),
                consultFinishAt = new DateTime(2019, 6, 18, 12, 0, 0)
            };

            var consultValidation = new ConsultValidation();

            var ex = Assert.Throws <Exception>(() => consultValidation.validStartBeforeFinish(consult));

            Assert.Equal(ex.Message, "The consult can not end before you start");
        }