//hostingEnvironmentPath - physical path to WebAPI folder //requestUriLeftPart - URL public LotSalesHandler(IUnitOfWork unitOfWork, ILotOperationsHandler lotOperationsHandler, IUserAccountOperationsHandler userAccountOperationsHandler, double refreshTimeMillisecs, double checkTimeMillisecs, string hostingEnvironment, string requestUriLeftPart, bool sendEmail = true) { mapper = new MapperConfiguration(cfg => { cfg.CreateMap <LotEntity, LotArchiveEntity>(); }).CreateMapper(); LotId_SellDatePairs = new Dictionary <int, DateTime>(); refreshTimer = new Timer(refreshTimeMillisecs); refreshTimer.AutoReset = true; refreshTimer.Elapsed += RefreshLots; checkTimer = new Timer(checkTimeMillisecs); checkTimer.AutoReset = true; checkTimer.Elapsed += CheckLots; this.hostingEnvironment = hostingEnvironment; this.requestUriLeftPart = requestUriLeftPart; this.UoW = unitOfWork; this.lotOperationsHandler = lotOperationsHandler; this.userAccountOperationsHandler = userAccountOperationsHandler; this.sendEmail = sendEmail; }
public void SetUp() { unitOfWork = UnitTestDependencyResolver.ResolveUnitOfWork(); lotOperationsHandler = UnitTestDependencyResolver.ResolveLotOperationsHandler(unitOfWork); userAccountOperationsHandler = UnitTestDependencyResolver.ResolveUserAccountOperationsHandler(unitOfWork); lotCommentOperationsHandler = UnitTestDependencyResolver.ResolveLotCommentOperationsHandler(unitOfWork); }
public async Task SetUpAsync() { unitOfWork = UnitTestDependencyResolver.ResolveUnitOfWork(); lotOperationsHandler = UnitTestDependencyResolver.ResolveLotOperationsHandler(unitOfWork); userAccountOperationsHandler = UnitTestDependencyResolver.ResolveUserAccountOperationsHandler(unitOfWork); lotCommentOperationsHandler = UnitTestDependencyResolver.ResolveLotCommentOperationsHandler(unitOfWork); await userAccountOperationsHandler.AddUserAccountAsync(new UserAccountInfo { Name = "DefaultUser", Email = "*****@*****.**" }); }
public void SetUp() { unitOfWork = UnitTestDependencyResolver.ResolveUnitOfWork(); lotOperationsHandler = UnitTestDependencyResolver.ResolveLotOperationsHandler(unitOfWork); lotSalesHandler = UnitTestDependencyResolver.ResolveLotSalesHandler(unitOfWork, 1500, 500, "", ""); userAccountOperationsHandler = UnitTestDependencyResolver.ResolveUserAccountOperationsHandler(unitOfWork); userAccountOperationsHandler.AddUserAccount(new UserAccountInfo { Name = "DefaultUser", Email = "*****@*****.**" }); userAccountOperationsHandler.AddUserAccount(new UserAccountInfo { Name = "DefaultUser2", Email = "*****@*****.**" }); }
protected virtual void Dispose(bool disposing) { if (!disposed) { UoW.Dispose(); if (disposing) { lotOperationsHandler = null; mapper = null; UoW = null; } } disposed = true; }
public LotPhotoOperationsHandler(IUnitOfWork unitOfWork, ILotOperationsHandler lotOperationsHandler) { mapper = new MapperConfiguration(cfg => { cfg.CreateMap <LotEntity, Lot>() .ForAllMembers(opt => opt.Ignore()); cfg.CreateMap <UserAccountInfoEntity, UserAccountInfo>() .ForAllMembers(opt => opt.Ignore()); cfg.CreateMap <LotPhotoEntity, LotPhoto>() .ForMember(dest => dest.Lot, opt => opt.Ignore()); cfg.CreateMap <LotCommentEntity, LotComment>() .ForAllMembers(opt => opt.Ignore()); cfg.CreateMap <LotPhoto, LotPhotoEntity>(); }).CreateMapper(); this.UoW = unitOfWork; this.lotOperationsHandler = lotOperationsHandler; }
public static ILotPhotoOperationsHandler ResolveLotPhotoOperationsHandler(IUnitOfWork unitOfWork, ILotOperationsHandler lotOperationsHandler) { return(new LotPhotoOperationsHandler(unitOfWork, lotOperationsHandler)); }
public static ILotPhotoOperationsHandler ResolveLotPhotoOperationsHandler(ILotOperationsHandler lotOperationsHandler) { return(new LotPhotoOperationsHandler(ResolveUnitOfWork(), lotOperationsHandler)); }