public void ProjectionService_GetProjectionByIdAsync_IncorrectId_ReturnNull() { //Arrange Projection projection = null; ProjectionService projectionsService = new ProjectionService(_mockProjectionsRepository.Object, _mockReservationService.Object); _mockProjectionsRepository.Setup(x => x.GetByIdAsync(It.IsAny <Guid>())).Returns(Task.FromResult(projection)); _mockProjectionsRepository.Setup(x => x.Save()); //Act var resultAction = projectionsService.GetProjectionByIdAsync(_projection.Id).ConfigureAwait(false).GetAwaiter().GetResult(); //Assert Assert.IsNull(resultAction); Assert.IsNotInstanceOfType(resultAction, typeof(ProjectionDomainModel)); }