Exemplo n.º 1
0
 public PostCreateDemandData(ICourseDemand item)
 {
     Id = item.Id;
     OrganisationName    = item.OrganisationName;
     ContactEmailAddress = item.ContactEmailAddress;
     Course              = item.Course;
     Location            = item.LocationItem;
     NumberOfApprentices = item.NumberOfApprenticesKnown.HasValue && item.NumberOfApprenticesKnown.Value
         ? Convert.ToInt32(item.NumberOfApprentices) : 0;
 }
Exemplo n.º 2
0
        public async Task Then_The_Item_Is_Created_In_The_Cache_For_Thirty_Minutes(
            ICourseDemand item,
            [Frozen] Mock <ICacheStorageService> cacheStorageService,
            DemandService service)
        {
            //Act
            await service.CreateCacheCourseDemand(item);

            //Assert
            cacheStorageService.Verify(x => x.SaveToCache($"{item.Id}", item, TimeSpan.FromMinutes(30)));
        }
Exemplo n.º 3
0
 public async Task CreateCacheCourseDemand(ICourseDemand item)
 {
     await _cacheStorageService.SaveToCache(item.Id.ToString(), item, TimeSpan.FromMinutes(30));
 }