public UnitTestXMLDispacher() { CreateTestRepositories repoes = new CreateTestRepositories(); Database = repoes.CreateIoWManager(); Service = new XMLDispatcher(Database); }
public UnitTestXmlCreatorService() { CreateTestRepositories repoes = new CreateTestRepositories(); repo = repoes.CreateIoWManager(); _service = new XmlCreatorPogran(repo); _xmlDispatcher = new XMLDispatcher(repo); }
public FromDALToBLLProfile(IUnitOfWork database) { _database = database; _xmlDispatcher = new XMLDispatcher(database); mapperVisitor = new MapperConfiguration(cfg => cfg.AddProfile(new FromDALToBLLProfileWithModelVisitor(database))).CreateMapper(); //anketa service CreateMap <GroupVisitor, AnketaDTO>(). ForMember(dest => dest.CountMembers, opt => opt.MapFrom(src => src.Visitors.Count())). ForMember(dest => dest.DateArrival, opt => opt.MapFrom(src => src.DateArrival.HasValue ? src.DateArrival.Value.Date : src.DateArrival)). ForMember(dest => dest.Status, opt => opt.MapFrom(src => CheckAllStatuses(src.Visitors))). ForMember(dest => dest.Operator, opt => opt.MapFrom(src => src.TranscriptUser)). ForMember(dest => dest.CheckPoint, opt => opt.MapFrom(src => src.CheckPoint.Name)). ForMember(dest => dest.Arrived, opt => opt.MapFrom(src => CheckAllArrivals(src.Visitors))); //visitors CreateMap <Visitor, VisitorDTO>(). ForMember(dest => dest.Group, opt => opt.Ignore()). ForMember(dest => dest.Nationality, opt => opt.MapFrom(src => src.Nationality.Name)). ForMember(dest => dest.Gender, opt => opt.MapFrom(src => src.Gender.Name)); CreateMap <VisitorDTO, Visitor>(). ForMember(dest => dest.Nationality, opt => opt.MapFrom(src => database.Nationalities.GetAll().SingleOrDefault(n => n.Name == src.Nationality))). ForMember(dest => dest.Gender, opt => opt.MapFrom(src => database.Genders.GetAll().SingleOrDefault(n => n.Name == src.Gender))); ///// //group service CreateMap <GroupVisitorDTO, GroupVisitor>(). ForMember(dest => dest.CheckPoint, opt => opt.MapFrom(src => database.CheckPoints.GetAll().SingleOrDefault(n => n.Name == src.CheckPoint))); CreateMap <GroupVisitor, GroupVisitorDTO>(). ForMember(dest => dest.CheckPoint, opt => opt.MapFrom(src => src.CheckPoint.Name)); //User CreateMap <ProfileUserDTO, OperatorProfile>(); CreateMap <OperatorProfile, ProfileUserDTO>(); CreateMap <UserDTO, BezvizUser>(). ForMember(dest => dest.OperatorProfile, opt => opt.MapFrom(src => src.ProfileUser)). ForMember(dest => dest.Id, opt => opt.MapFrom(src => new BezvizUser().Id)); CreateMap <BezvizUser, UserDTO>(). ForMember(dest => dest.ProfileUser, opt => opt.MapFrom(src => src.OperatorProfile)); //// CreateMap <Nationality, NationalityDTO>(); CreateMap <CheckPoint, CheckPointDTO>(); CreateMap <Gender, GenderDTO>(); }
public IntegratedTest() { database = new IdentityUnitOfWork(CONNECT); xmlDispatcher = database.XMLDispatchManager; xmlDispatcherService = new XMLDispatcher(database); visitorService = serviceCreator.CreateVisitorService(CONNECT); //groupService = serviceCreator.CreateGroupService(CONNECT); groupService = new GroupService(database); checkPoint = serviceCreator.CreateCheckPointService(CONNECT); nationalities = serviceCreator.CreateNationalityService(CONNECT); genders = serviceCreator.CreateGenderService(CONNECT); userService = serviceCreator.CreateUserService(CONNECT); reportService = serviceCreator.CreateReport(CONNECT); accountController = new AccountController(userService); visitorController = new VisitorController(groupService, checkPoint, nationalities, genders); groupController = new GroupController(groupService, checkPoint, nationalities, genders); anketaController = new AnketaController(anketaService, groupService, checkPoint, nationalities, genders); operatorController = new OperatorController(userService); reporterController = new ReportController(reportService); }
public VisitorService(IUnitOfWork uow) { _database = uow; _xmlDispatcher = new XMLDispatcher(_database); _mapper = new MapperConfiguration(cfg => cfg.AddProfile(new FromDALToBLLProfile(_database))).CreateMapper(); }