public async Task GetEducations_ReturnsOkObjectResult() { //Arrange _mockCalendarService .Setup(x => x.GetAllEducations()) .ReturnsAsync(GetAllEventsTest()); //Act var result = await _eventsCalendarController.GetEducations(); //Assert _mockCalendarService.Verify(); Assert.IsNotNull(result); Assert.IsInstanceOf <OkObjectResult>(result); }
public async Task GetEducations_ReturnsOkObjectResult() { //Arrange _mockCalendarService .Setup(x => x.GetAllEducations()) .ReturnsAsync(GetAllEventsTest()); //Act var result = await _eventsCalendarController.GetEducations(); //Assert _mockCalendarService.Verify(); Assert.AreEqual(((result as ObjectResult).Value as IEnumerable <EventCalendarInfoDTO>).Count(), expectedCount); Assert.IsNotNull(result); Assert.IsInstanceOf <OkObjectResult>(result); }