public void Get_ShouldReturnNotFound_WhenGivenInvalidParameters(string releaseId, int logId, string because = null) { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var mockRepository = CreateDataStore(); var controller = new NewsReleaseLogsController(mockRepository.Object, _logger.Object, _mapper.Object); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- var result = controller.Get(releaseId, logId); // does not exist... //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should().BeOfType(typeof(NotFoundResult), because); }
public void Get_ShouldReturnSuccess() { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var mockRepository = CreateDataStore(); var controller = new NewsReleaseLogsController(mockRepository.Object, _logger.Object, _mapper.Object); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- var result = controller.Get("0", 1); //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should().BeOfType(typeof(OkObjectResult), "because the read operation should go smoothly"); }