public async Task ReturnsNoContentWhenNoData(string mediaTypeName) { // Arrange List <CurrentOpportunitiesSegmentModel> expectedResult = null; var controller = BuildSegmentController(mediaTypeName); A.CallTo(() => FakeCurrentOpportunitiesSegmentService.GetAllAsync()).Returns(expectedResult); // Act var result = await controller.RefreshDocuments().ConfigureAwait(false); // Assert A.CallTo(() => FakeJobProfileSegmentRefreshService.SendMessageListAsync(A <List <RefreshJobProfileSegmentServiceBusModel> > .Ignored)).MustNotHaveHappened(); var statusResult = Assert.IsType <NoContentResult>(result); A.CallTo(() => FakeLogger.LogWarning(A <string> .Ignored)).MustHaveHappenedOnceExactly(); Assert.Equal((int)HttpStatusCode.NoContent, statusResult.StatusCode); controller.Dispose(); }