Пример #1
0
        public async Task GetActions_ReturnsOkObjectResult()
        {
            //Arrange
            _mockCalendarService
            .Setup(x => x.GetAllActions())
            .ReturnsAsync(GetAllEventsTest());

            //Act
            var result = await _eventsCalendarController.GetActions();

            //Assert
            _mockCalendarService.Verify();
            Assert.IsNotNull(result);
            Assert.IsInstanceOf <ObjectResult>(result);
        }
        public async Task GetActions_ReturnsOkObjectResult()
        {
            //Arrange
            _mockCalendarService
            .Setup(x => x.GetAllActions())
            .ReturnsAsync(GetAllEventsTest());

            //Act
            var result = await _eventsCalendarController.GetActions();

            //Assert
            _mockCalendarService.Verify();
            Assert.IsNotNull(result);
            Assert.AreEqual(((result as ObjectResult).Value as IEnumerable <EventCalendarInfoDTO>).Count(), expectedCount);
            Assert.IsInstanceOf <ObjectResult>(result);
        }