Here are the examples of the csharp api System.Threading.Tasks.Task.FromResult(UnitDisposition) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
Source : TestUnitDispositionService.cs
with MIT License
from codenesium
with MIT License
from codenesium
[Fact]
public async void Get_ShouldReturnNullBecauseRecordNotFound()
{
var mock = new ServiceMockFacade<IUnitDispositionService, IUnitDispositionRepository>();
mock.RepositoryMock.Setup(x => x.Get(It.IsAny<int>())).Returns(Task.FromResult<UnitDisposition>(null));
var service = new UnitDispositionService(mock.LoggerMock.Object,
mock.MediatorMock.Object,
mock.RepositoryMock.Object,
mock.ModelValidatorMockFactory.UnitDispositionModelValidatorMock.Object,
mock.DALMapperMockFactory.DALUnitDispositionMapperMock);
ApiUnitDispositionServerResponseModel response = await service.Get(default(int));
response.Should().BeNull();
mock.RepositoryMock.Verify(x => x.Get(It.IsAny<int>()));
}