Exemple #1
0
        public void DateIsAfterCurrent_Year_Expected(int year, bool expected)
        {
            Mock <IDatos>   idatos          = new Mock <IDatos>();
            DateTimeService dateTimeService = new DateTimeService();

            idatos.Setup(m => m.Date).Returns(new DateTime(year, 1, 1));
            dateTimeService.CurrentDateTime = () => new DateTime(2020, 1, 1);
            var result = dateTimeService.DateIsAfterCurrent(idatos.Object);

            Assert.AreEqual(expected, result);
        }