public async Task Then_If_It_Doesnt_Exist_Null_Is_Returned( Guid employerDemandKey, [Frozen] Mock <ICacheStorageService> cacheStorageService, DemandService service) { //Arrange cacheStorageService.Setup(x => x.RetrieveFromCache <ICourseDemand>(It.IsAny <string>())) .ReturnsAsync((ICourseDemand)null); //Act var actual = await service.GetCachedCourseDemand(employerDemandKey); //Assert actual.Should().BeNull(); }
public async Task Then_The_Item_Is_Retrieved_From_The_Cache( Guid employerDemandKey, CourseDemandRequest item, [Frozen] Mock <ICacheStorageService> cacheStorageService, DemandService service) { //Arrange cacheStorageService.Setup(x => x.RetrieveFromCache <CourseDemandRequest>(employerDemandKey.ToString())) .ReturnsAsync(item); //Act var actual = await service.GetCachedCourseDemand(employerDemandKey); //Assert actual.Should().BeEquivalentTo(item); }