예제 #1
0
        public void Calls_INotificationService()
        {
            // arrange
            // act
            var result = _controller.GetAll();

            // assert
            _notificationService.Verify(mq => mq.QueryAll(), Times.Once);
        }
예제 #2
0
        public void Has_GetAll()
        {
            // arrange
            var controller = new NotificationsController(_notificationService.Object);
            // act
            var result = controller.GetAll();

            // assert
            result.Should().NotBeNull();
        }
예제 #3
0
        public async Task GetAll_ReturnsOkObjectResultWithNotificationDtos()
        {
            var notifications = new List <NotificationDto>();

            _notificationsServiceMock.Setup(obj => obj.GetAllForCurrentUserAsync())
            .ReturnsAsync(notifications);

            var result = await _controller.GetAll();

            _notificationsServiceMock.Verify(obj => obj.GetAllForCurrentUserAsync());

            result.Result
            .Should()
            .BeOfType <OkObjectResult>()
            .Subject.Value
            .Should()
            .Be(notifications);
        }