示例#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);
        }