Exemple #1
0
        public async Task SendNullToAddInterval()
        {
            IRepository <Interval> repository = new Repository <Interval>(databaseContext);
            Logger           logger           = new Logger(new Repository <Log>(databaseContext));
            ValuesController controller       = new ValuesController(repository, logger);
            IActionResult    result           = await controller.AddInterval(null);

            Assert.IsType <BadRequestObjectResult>(result);
        }
Exemple #2
0
        public async Task SendCorrectDatesToAddInterval()
        {
            Interval interval = new Interval()
            {
                Start = DateTime.Now,
                End   = DateTime.Now.AddDays(23),
            };
            IRepository <Interval> repository = new Repository <Interval>(databaseContext);
            Logger           logger           = new Logger(new Repository <Log>(databaseContext));
            ValuesController controller       = new ValuesController(repository, logger);
            IActionResult    result           = await controller.AddInterval(interval);

            Assert.IsType <OkResult>(result);
        }