public async Task GetAllUserNotification_Valid_Test(string id)
        {
            //Arrange
            _notificationService.Setup(cs => cs.GetAllUserNotificationsAsync(It.IsAny <string>())).ReturnsAsync(new List <UserNotificationDTO>());

            NotificationBoxController notificationBoxController = _notificationBoxController;

            //Act
            var result = await notificationBoxController.GetAllUserNotification(id);

            //Assert
            Assert.IsInstanceOf <OkObjectResult>(result);
            Assert.NotNull(result);
        }
Beispiel #2
0
        public async Task GetAllUserNotification_Valid_Test(string id)
        {
            //Arrange
            var list = new List <UserNotificationDTO>()
            {
                new UserNotificationDTO()
            };

            _notificationService.Setup(cs => cs.GetAllUserNotificationsAsync(It.IsAny <string>())).ReturnsAsync(list);

            NotificationBoxController notificationBoxController = _notificationBoxController;

            //Act
            var result = await notificationBoxController.GetAllUserNotification(id);

            var resultCount = ((IEnumerable <UserNotificationDTO>)(result as ObjectResult).Value).Count();

            //Assert
            Assert.IsInstanceOf <OkObjectResult>(result);
            Assert.AreEqual(resultCount, list.Count);
            Assert.NotNull(result);
        }