public async Task PostScheduleReturnsCreaterAtActionResultTest()
        {
            // Arrange
            int      testId     = 1;
            Schedule schedule   = GetTestSchedules().FirstOrDefault(p => p.Id == testId);
            var      mockLogger = new Mock <ILogger <SchedulesController> >();
            var      mockRepo   = new Mock <IVenuesRepository>();

            mockRepo.Setup(c => c.AddSchedule(schedule)).Verifiable();
            mockRepo.Setup(c => c.SaveChanges())
            .Returns(Task.CompletedTask);
            var controller = new SchedulesController(mockRepo.Object, mockLogger.Object);

            // Act
            var result = await controller.PostSchedule(schedule);

            // Assert
            var requestResult = Assert.IsType <CreatedAtActionResult>(result);
            var model         = Assert.IsType <Schedule>(requestResult.Value);

            Assert.Equal(schedule.Id, model.Id);
            Assert.Equal(schedule.VenueId, model.VenueId);
            Assert.Equal(schedule.ConcertId, model.ConcertId);
            Assert.Equal(schedule.Date, model.Date);
        }
        public async Task PostScheduleReturnsBadRequestResultTest()
        {
            // Arrange & Act
            var mockRepo   = new Mock <IVenuesRepository>();
            var mockLogger = new Mock <ILogger <SchedulesController> >();
            var controller = new SchedulesController(mockRepo.Object, mockLogger.Object);

            controller.ModelState.AddModelError("error", "some error");

            // Act
            var result = await controller.PostSchedule(schedule : null);

            // Assert
            Assert.IsType <BadRequestObjectResult>(result);
        }