コード例 #1
0
        public async Task GetAllTypes_Valid_Test()
        {
            //Arrange
            _notificationService.Setup(cs => cs.GetAllNotificationTypesAsync()).ReturnsAsync(new List <NotificationTypeDTO>());

            NotificationBoxController notificationBoxController = _notificationBoxController;

            //Act
            var result = await notificationBoxController.GetAllTypes();

            //Assert
            Assert.IsInstanceOf <OkObjectResult>(result);
            Assert.NotNull(result);
        }
コード例 #2
0
        public async Task GetAllTypes_Valid_Test()
        {
            //Arrange
            var list = new List <NotificationTypeDTO>()
            {
                new NotificationTypeDTO()
            };

            _notificationService.Setup(cs => cs.GetAllNotificationTypesAsync()).ReturnsAsync(list);

            NotificationBoxController notificationBoxController = _notificationBoxController;

            //Act
            var result = await notificationBoxController.GetAllTypes();

            //Assert
            Assert.AreEqual(((result as ObjectResult).Value as IEnumerable <NotificationTypeDTO>).Count(), list.Count);
            Assert.IsInstanceOf <OkObjectResult>(result);
            Assert.NotNull(result);
        }