Exemple #1
0
 public void SetUp()
 {
     _mapper               = DtoMappings.GetMapperConfiguration().CreateMapper();
     _userRepository       = new UserRepository(_connection);
     _assignmentRepository = new AssignmentRepository(_connection, _mapper);
     _planRepository       = new PlanRepository(_connection, _mapper);
     _user = _userRepository.GetUser(1).Result;
 }
Exemple #2
0
 public void Setup()
 {
     _planRepositoryMock  = new Mock <IPlanRepository>();
     _mapper              = DtoMappings.GetMapperConfiguration().CreateMapper();
     _loggerMock          = new Mock <ILogger <PlanService> >();
     _groupRepositoryMock = new Mock <IGroupRepository>();
     _planService         = new PlanService(_planRepositoryMock.Object, _loggerMock.Object, _mapper, _groupRepositoryMock.Object);
 }
Exemple #3
0
 public override void Initialize()
 {
     IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
     Configuration.Modules.AbpAutoMapper().Configurators.Add(mapper =>
     {
         DtoMappings.Map(mapper);
     });
 }
        public void SetUp()
        {
            var mapper = DtoMappings.GetMapperConfiguration().CreateMapper();

            _shiftRepository      = new ShiftRepository(_connection);
            _assignmentRepository = new AssignmentRepository(_connection, mapper);
            _planRepository       = new PlanRepository(_connection, mapper);
        }
Exemple #5
0
 public void Setup()
 {
     _loggerMock           = new Mock <ILogger <UserService> >();
     _groupRepositoryMock  = new Mock <IGroupRepository>();
     _userRepositoryMock   = new Mock <IUserRepository>();
     _emailServiceMock     = new Mock <IEmailService>();
     _patrolRepositoryMock = new Mock <IPatrolRepository>();
     _mapper      = DtoMappings.GetMapperConfiguration().CreateMapper();
     _userService = new UserService(_loggerMock.Object, _userRepositoryMock.Object, _emailServiceMock.Object, _groupRepositoryMock.Object, _patrolRepositoryMock.Object, _mapper);
 }
Exemple #6
0
        public void SetUp()
        {
            _mapper           = DtoMappings.GetMapperConfiguration().CreateMapper();
            _planRepository   = new PlanRepository(_connection, _mapper);
            _patrolRepository = new PatrolRepository(_connection);
            _userRepository   = new UserRepository(_connection);

            _user   = _userRepository.GetUser(1).Result;
            _patrol = _patrolRepository.GetPatrolsForUser(_user.Id).Result.First(x => x.Name == "Big Mountain Patrol");
            _plan   = _planRepository.GetPlansForPatrol(_patrol.Id).Result.First(x => x.Name == "Ski Alpine");
        }
Exemple #7
0
        public void Setup()
        {
            _announcementRepositoryMock = new Mock <IAnnouncementRepository>();
            _mapper               = DtoMappings.GetMapperConfiguration().CreateMapper();
            _loggerMock           = new Mock <ILogger <EventService> >();
            _systemClockMock      = new Mock <ISystemClock>();
            _patrolRepositoryMock = new Mock <IPatrolRepository>();
            _userRepositoryMock   = new Mock <IUserRepository>();
            _emailService         = new Mock <IEmailService>();

            _announcementService = new AnnouncementService(_announcementRepositoryMock.Object, _loggerMock.Object, _mapper, _systemClockMock.Object, _emailService.Object, _patrolRepositoryMock.Object, _userRepositoryMock.Object);
        }
Exemple #8
0
        public void Setup()
        {
            _assignmentRepositoryMock = new Mock <IAssignmentRepository>();
            _mapper              = DtoMappings.GetMapperConfiguration().CreateMapper();
            _loggerMock          = new Mock <ILogger <AssignmentService> >();
            _planServiceMock     = new Mock <IPlanService>();
            _patrolRepository    = new Mock <IPatrolRepository>();
            _groupRepositoryMock = new Mock <IGroupRepository>();
            _planRepositoryMock  = new Mock <IPlanRepository>();
            _systemClockMock     = new Mock <ISystemClock>();

            _assignmentService = new AssignmentService(_assignmentRepositoryMock.Object, _planServiceMock.Object, _loggerMock.Object, _planRepositoryMock.Object, _patrolRepository.Object, _groupRepositoryMock.Object, _mapper, _systemClockMock.Object);
        }
Exemple #9
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();
        }
 public void Setup()
 {
     _loggerMock           = new Mock <ILogger <WorkItemService> >();
     _groupRepositoryMock  = new Mock <IGroupRepository>();
     _userRepositoryMock   = new Mock <IUserRepository>();
     _emailServiceMock     = new Mock <IEmailService>();
     _patrolRepositoryMock = new Mock <IPatrolRepository>();
     _shiftRepositoryMock  = new Mock <IShiftRepository>();
     _workItemRepository   = new Mock <IWorkItemRepository>();
     _systemClockMock      = new Mock <ISystemClock>();
     _mapper          = DtoMappings.GetMapperConfiguration().CreateMapper();
     _workItemService = new WorkItemService(_loggerMock.Object, _patrolRepositoryMock.Object, _groupRepositoryMock.Object, _shiftRepositoryMock.Object, _systemClockMock.Object,
                                            _emailServiceMock.Object, _userRepositoryMock.Object, _workItemRepository.Object, _mapper);
 }
Exemple #11
0
        public void Setup()
        {
            _assignmentRepositoryMock = new Mock <IAssignmentRepository>();
            _mapper               = DtoMappings.GetMapperConfiguration().CreateMapper();
            _loggerMock           = new Mock <ILogger <ScheduleService> >();
            _shiftRepositoryMock  = new Mock <IShiftRepository>();
            _patrolRepository     = new Mock <IPatrolRepository>();
            _groupRepositoryMock  = new Mock <IGroupRepository>();
            _systemClockMock      = new Mock <ISystemClock>();
            _userRepositoryMock   = new Mock <IUserRepository>();
            _emailServiceMock     = new Mock <IEmailService>();
            _shiftWOrkItemService = new Mock <IShiftWorkItemService>();

            _scheduleService = new ScheduleService(_loggerMock.Object, _patrolRepository.Object, _groupRepositoryMock.Object, _shiftRepositoryMock.Object, _systemClockMock.Object, _emailServiceMock.Object, _userRepositoryMock.Object, _shiftWOrkItemService.Object);
        }
Exemple #12
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();

            // clear XML Support
            GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
        }
Exemple #13
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();

            FluentValidationModelValidatorProvider.Configure(
                provider =>
            {
                provider.ValidatorFactory = new DependencyResolverModelValidatorFactory();
                provider.Add(
                    typeof(IsEmailUniquePropertyValidator),
                    (metadata, context, rule, validator) => new IsEmailUniqueClientPropertyValidator(metadata, context, rule, validator));
            });
            //FluentValidationModelValidatorProvider.Configure();
        }
Exemple #14
0
 public TestService()
 {
     Logger.Info("Created TestService");
     //HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
     DtoMappings.Initialize();
 }
        public void SetUp()
        {
            //Initializaing Mappings
            DtoMappings.Initialize();


            //Initializing Data
            TestShoutBoxMessage = new ShoutBoxMessageModel {
                Author = "test", Message = "test", ShoutBoxId = 1, TimePosted = new DateTime(2010, 10, 10, 10, 10, 10)
            };
            TestShoutBoxMessage1 = new ShoutBoxMessageModel {
                Author = "test", Message = "testLatest", ShoutBoxId = 1, TimePosted = new DateTime(2011, 10, 10, 10, 10, 10)
            };
            TestQuestionAnswer = new TestQuestionAnswer {
                Correct = true, NumberSelected = 0, Text = "test"
            };
            TestQuestion = new TestQuestionModel
            {
                QuestionText = "test question", QuestionLabel = "test", Answers = new List <TestQuestionAnswer>
                {
                    TestQuestionAnswer
                }
            };
            TestTestType = new TestTypeModel {
                TypeName = "test"
            };
            TestPofile = new ProfileModel {
                LoginName = "test", Email = "*****@*****.**", IsActive = true
            };
            TestTest = new TestModel
            {
                Author = TestPofile, CreationDate = new DateTime(2010, 1, 1), Name = "test", TestType = TestTestType
            };
            LatestTest = new TestModel
            {
                Author = TestPofile, CreationDate = new DateTime(2011, 1, 1), Name = "test", TestType = TestTestType
            };
            TestCourseType = new CourseTypeModel {
                TypeName = "Fizyka"
            };
            TestCourseType1 = new CourseTypeModel {
                TypeName = "Matematyka"
            };
            TestGroupType = new GroupTypeModel {
                TypeName = "test"
            };
            TestGroupType1 = new GroupTypeModel {
                TypeName = "test1"
            };
            TestGroup = new GroupModel {
                GroupType = TestGroupType, GroupName = "test"
            };
            TestForum = new ForumModel {
                Author = "test", Name = "test"
            };
            TestShoutBox = new ShoutboxModel();
            TestShoutBox.Messages.Add(TestShoutBoxMessage);
            TestShoutBox.Messages.Add(TestShoutBoxMessage1);
            TestSurvey = new SurveyModel
            {
                SurveyText = "Smiga chodzi fruwa ?", DateCreated = new DateTime(2010, 1, 1)
            };
            TestLatestSurvey = new SurveyModel
            {
                SurveyText = "Smiga chodzi fruwa ?", DateCreated = new DateTime(2011, 1, 1)
            };


            TestCourse2 = new CourseModel
            {
                CourseType   = TestCourseType1,
                ShoutBox     = TestShoutBox,
                Forum        = TestForum,
                Group        = TestGroup,
                CreationDate = DateTime.Now,
                Description  = "test1",
                Logo         = "/test1.jpg",
                Name         = "test1",
                Password     = "******"
            };

            TestCourse3 = new CourseModel
            {
                CourseType   = TestCourseType1,
                ShoutBox     = TestShoutBox,
                Forum        = TestForum,
                Group        = TestGroup,
                CreationDate = DateTime.Now,
                Description  = "test1",
                Logo         = "/test1.jpg",
                Name         = "test1",
                Password     = null
            };
            TestContentType = new ContentTypeModel {
                TypeName = "test"
            };
            TestContent = new ContentModel
            {
                ContentUrl     = "test",
                CreationDate   = DateTime.Now,
                DownloadNumber = 0,
                Name           = "test",
                Text           = "test",
                Type           = TestContentType
            };
            TestJournalMark = new JournalMarkModel {
                Name = "Zaliczenie", Value = "5"
            };
            TestJournal = new JournalModel
            {
                Course = TestCourse3, Marks = new List <JournalMarkModel>
                {
                    TestJournalMark
                }, Name = "test journal"
            };

            FileModel = new FileModel {
                FileName = "test", Address = "test"
            };
            SectionModel = new SectionModel {
                IconName = "test", Text = "test", Title = "tset"
            };

            LearningMaterialModel = new LearningMaterialModel
            {
                Level         = 1,
                CreationDate  = DateTime.Now,
                Description   = "test",
                Goals         = "test",
                Summary       = "test",
                UpdateDate    = DateTime.Now,
                VersionNumber = "111",
                Tests         = new List <TestModel> {
                    TestTest
                },
                Files = new List <FileModel> {
                    FileModel
                },
                Sections = new List <SectionModel> {
                    SectionModel
                }
            };
            TestCourse1 = new CourseModel
            {
                CourseType        = TestCourseType,
                ShoutBox          = TestShoutBox,
                Forum             = TestForum,
                Group             = TestGroup,
                CreationDate      = DateTime.Now,
                Description       = "test",
                Logo              = "/test.jpg",
                Name              = "test",
                Password          = "******",
                LearningMaterials = new List <LearningMaterialModel> {
                    LearningMaterialModel
                }
            };

            using (var session = DataAccess.OpenSession())
            {
                session.Save(TestPofile);
                session.Save(TestShoutBoxMessage);
                session.Save(TestShoutBoxMessage1);
                session.Save(TestCourseType);
                session.Save(TestGroupType);
                session.Save(TestGroupType1);
                session.Save(TestGroup);
                session.Save(TestForum);
                session.Save(TestShoutBox);
                session.Save(TestCourseType1);
                session.Save(TestSurvey);
                session.Save(TestLatestSurvey);
                session.Save(TestTestType);
                session.Save(TestTest);
                session.Save(LatestTest);
                session.Save(TestCourse1);
                session.Save(TestCourse2);
                session.Save(TestQuestionAnswer);
                session.Save(TestQuestion);
                session.Save(TestCourse3);
                session.Save(TestJournalMark);
                session.Save(TestJournal);
                session.Save(TestContentType);
                session.Save(TestContent);
                session.Save(FileModel);
                session.Save(SectionModel);
                session.Save(LearningMaterialModel);
                session.Flush();
            }
        }
 public ProfileService(IRoleProvider provider)
 {
     _roleProvider = provider;
     DtoMappings.Initialize();
 }
Exemple #17
0
 public CourseService()
 {
     HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
     DtoMappings.Initialize();
 }
Exemple #18
0
 public override void PreInitialize()
 {
     DtoMappings.Map(Configuration.Modules.AbpAutoMapper());
 }
Exemple #19
0
 private void UseAutoMapper()
 {
     DtoMappings.Map();
 }
        //private static void _SetupRefreshJob()
        //{

        //    //remove a previous job
        //    Action remove = HttpContext.Current.Cache["Refresh"] as Action;
        //    if (remove is Action)
        //    {
        //        HttpContext.Current.Cache.Remove("Refresh");
        //        remove.EndInvoke(null);
        //    }

        //    //get the worker
        //    Action work = () => {
        //        while (true)
        //        {
        //            Thread.Sleep(60000);
        //            WebClient refresh = new WebClient();
        //            try
        //            {
        //                refresh.UploadString("http://salesapp.ssg-sy.com", string.Empty);
        //                refresh.UploadString("http://salesapp.ssg-sy.com/remote", string.Empty);
        //            }
        //            catch (Exception ex)
        //            {
        //                //snip...
        //            }
        //            finally
        //            {
        //                refresh.Dispose();
        //            }
        //        }
        //    };
        //    work.BeginInvoke(null, null);

        //    //add this job to the cache
        //    HttpContext.Current.Cache.Add(
        //        "Refresh",
        //        work,
        //        null,
        //        Cache.NoAbsoluteExpiration,
        //        Cache.NoSlidingExpiration,
        //        CacheItemPriority.Normal,
        //        (s, o, r) => { _SetupRefreshJob(); }
        //        );
        //}
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Initialize Mapper
            DtoMappings.Initialize();

            //Initialise Bootstrapper
            Bootstrapper.Initialise();

            FluentValidationModelValidatorProvider.Configure(
                provider =>
            {
                provider.ValidatorFactory = new DependencyResolverModelValidatorFactory();

                provider.Add(
                    typeof(IsEmailUniquePropertyValidator),
                    (metadata, context, rule, validator) => new IsEmailUniqueClientPropertyValidator(metadata, context, rule, validator));

                /// GuideCity ///
                // provider.Add(
                //    typeof(GuideIsArabicNameAddUniquePropertyValidator),
                //    (metadata, context, rule, validator) => new GuideIsArabicNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //   typeof(GuideIsEnglishNameAddUniquePropertyValidator),
                //   (metadata, context, rule, validator) => new GuideIsEnglishNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //   typeof(GuideIsArabicNameEditUniquePropertyValidator),
                //   (metadata, context, rule, validator) => new GuideIsArabicNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //  typeof(GuideIsEnglishNameEditUniquePropertyValidator),
                //  (metadata, context, rule, validator) => new GuideIsEnglishNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //typeof(GuideIsExistIdEditUniquePropertyValidator),
                //(metadata, context, rule, validator) => new GuideIsExistIdEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                //// provider.Add(
                //typeof(GuideIsCityIdExistPropertyValidator),
                //(metadata, context, rule, validator) => new GuideIsCityIdExistClientPropertyValidator(metadata, context, rule, validator));


                /// GuideTown ///
                //  provider.Add(
                // typeof(GuideIsIdExistTownPropertyValidator),
                // (metadata, context, rule, validator) => new GuideIsIdExistTownClientPropertyValidator(metadata, context, rule, validator));
                ////  provider.Add(
                //typeof(GuideIsCityIdExistPropertyValidator),
                //(metadata, context, rule, validator) => new GuideIsCityIdExistClientPropertyValidator(metadata, context, rule, validator));

                /// City ///
                // provider.Add(
                //    typeof(IsArabicNameAddUniquePropertyValidator),
                //    (metadata, context, rule, validator) => new IsArabicNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                //    typeof(IsEnglishNameAddUniquePropertyValidator),
                //    (metadata, context, rule, validator) => new IsEnglishNameAddUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                // typeof(IsArabicNameEditUniquePropertyValidator),
                // (metadata, context, rule, validator) => new IsArabicNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                // typeof(IsEnglishNameEditUniquePropertyValidator),
                // (metadata, context, rule, validator) => new IsEnglishNameEditUniqueClientPropertyValidator(metadata, context, rule, validator));
                // provider.Add(
                // typeof(IsExistIdEditUniquePropertyValidator),
                //(metadata, context, rule, validator) => new IsExistIdEditUniqueClientPropertyValidator(metadata, context, rule, validator));


                /// Town ///
                //provider.Add(
                // typeof(IsCityIdExistPropertyValidator),
                //(metadata, context, rule, validator) => new IsCityIdExistClientPropertyValidator(metadata, context, rule, validator));
                //  provider.Add(
                // typeof(IsIdExistTownPropertyValidator),
                //(metadata, context, rule, validator) => new IsIdExistTownClientPropertyValidator(metadata, context, rule, validator));
                //  provider.Add(
                // typeof(IsPlaceIdUniqueAddPropertyValidator),
                //(metadata, context, rule, validator) => new IsPlaceIdUniqueAddClientPropertyValidator(metadata, context, rule, validator));

                //   provider.Add(
                // typeof(IsPlaceIdUniqueEditPropertyValidator),
                //(metadata, context, rule, validator) => new IsPlaceIdUniqueEditClientPropertyValidator(metadata, context, rule, validator));


                /// Classify ///
            });

            AntiForgeryConfig.SuppressIdentityHeuristicChecks = true;


            //SignalR start for notifications
            SignalHelper.Start();
        }