public void Calls_INotificationService() { // arrange // act var result = _controller.GetAll(); // assert _notificationService.Verify(mq => mq.QueryAll(), Times.Once); }
public void Has_GetAll() { // arrange var controller = new NotificationsController(_notificationService.Object); // act var result = controller.GetAll(); // assert result.Should().NotBeNull(); }
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); }