Пример #1
0
        public override void createTestFixture()
        {
            base.createTestFixture();
            ObjectsConverter.Configure();
            configureLogging();
            clientInformation = new ClientInformation()
            {
                Version = Const.ServiceVersion
            };
            clientInformation.ApplicationLanguage = "en";
            clientInformation.PlatformVersion     = "fgfdgdfg";
            clientInformation.ApplicationVersion  = "1.0.0.0";
            var conf = new ConfigurationSourceBuilder();

            conf.ConfigureCaching().ForCacheManagerNamed(SecurityManager.AuthenticationCacheName).StoreInMemory();

            var configSource = new DictionaryConfigurationSource();

            conf.UpdateConfigurationWithReplace(configSource);

            var xmlStream       = DateTimeExtension.GetResource("BodyArchitect.UnitTests.V2.BAPointsTests.BAPoints.xml");
            var paymentsManager = new PaymentsManager();

            this.paymentsManager = paymentsManager.Load(xmlStream);
            InternalBodyArchitectService.PaymentsManager = this.paymentsManager;
            EnterpriseLibraryContainer.Current           = EnterpriseLibraryContainer.CreateDefaultContainer(configSource);
        }
Пример #2
0
        public void Setup()
        {
            ObjectsConverter.Configure();
            ExercisesBuilderPL exercisesBuilder = new ExercisesBuilderPL();

            exercises = exercisesBuilder.Create().ToDictionary(t => t.GlobalId);
        }
Пример #3
0
        public override void createTestFixture()
        {
            base.createTestFixture();
            ObjectsConverter.Configure();
            configureLogging();
            clientInformation = new ClientInformation()
            {
                Version = Const.ServiceVersion
            };
            clientInformation.ApplicationLanguage = "en";
            clientInformation.PlatformVersion     = "fgfdgdfg";
            clientInformation.ApplicationVersion  = "1.0.0.0";
            var conf = new ConfigurationSourceBuilder();

            conf.ConfigureCaching().ForCacheManagerNamed(SecurityManager.AuthenticationCacheName).StoreInMemory();

            var configSource = new DictionaryConfigurationSource();

            conf.UpdateConfigurationWithReplace(configSource);

            EnterpriseLibraryContainer.Current = EnterpriseLibraryContainer.CreateDefaultContainer(configSource);
        }
Пример #4
0
 public void Setup()
 {
     ObjectsConverter.Configure();
 }
Пример #5
0
        public override void BuildDatabase()
        {
            ObjectsConverter.Configure();
            using (var tx = Session.BeginTransaction())
            {
                profiles.Clear();
                workoutPlans.Clear();
                exercises.Clear();
                TestService_GetExercises.BuildTwoProfilesDatabase(Session, profiles, exercises);

                profiles[0].Statistics.StrengthTrainingEntriesCount = 40;

                //remove all favorites items
                profiles[0].FavoriteWorkoutPlans.Clear();
                Session.Update(profiles[0]);
                profiles[1].FavoriteWorkoutPlans.Clear();
                Session.Update(profiles[1]);

                Profile profile1 = profiles[0];
                Profile profile2 = profiles[1];



                //creates workout plans for profile 1
                var workoutPlan = createPlan(profile1, "test1-1", PublishStatus.Published, TrainingPlanDifficult.Beginner, TrainingType.HST);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile1, "test1-2", PublishStatus.Private, TrainingPlanDifficult.Advanced, TrainingType.HST, exercises["t11"], exercises["t12"], exercises["t01"]);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);

                workoutPlan = createPlan(profile1, "test1-3", PublishStatus.Published, TrainingPlanDifficult.Beginner, TrainingType.PushPull);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile1, "test1-4", PublishStatus.Private, TrainingPlanDifficult.NotSet, TrainingType.Split, exercises["t01"], exercises["t12"], exercises["t22"]);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile1, "test1-5", PublishStatus.Private, TrainingPlanDifficult.Beginner, TrainingType.FBW);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile1, "test1-6", PublishStatus.Published, TrainingPlanDifficult.Professional, TrainingType.Split);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile1, "test1-7", PublishStatus.Published, TrainingPlanDifficult.Beginner, TrainingType.ACT);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);

                //now for profile 2
                workoutPlan = createPlan(profile2, "test2-1", PublishStatus.Private, TrainingPlanDifficult.Advanced, TrainingType.HST);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile2, "test2-2", PublishStatus.Published, TrainingPlanDifficult.Professional, TrainingType.ACT);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile2, "test2-3", PublishStatus.Published, TrainingPlanDifficult.Beginner, TrainingType.PushPull);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile2, "test2-4", PublishStatus.Published, TrainingPlanDifficult.NotSet, TrainingType.HIT);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile2, "test2-5", PublishStatus.Private, TrainingPlanDifficult.Beginner, TrainingType.Split);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile2, "test2-6", PublishStatus.Private, TrainingPlanDifficult.Advanced, TrainingType.ACT);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile2, "test2-7", PublishStatus.Published, TrainingPlanDifficult.NotSet, TrainingType.FBW);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);
                workoutPlan = createPlan(profile2, "test2-8", PublishStatus.Private, TrainingPlanDifficult.Beginner, TrainingType.Split);
                workoutPlans.Add(workoutPlan.Name, workoutPlan);

                ////add favorities for profile 1
                //profile1.FavoriteWorkoutPlans.Add(workoutPlans["test2-2"]);
                //Session.SaveOrUpdate(profile1);
                ////and for profile 2
                //profile2.FavoriteWorkoutPlans.Add(workoutPlans["test1-1"]);
                //profile2.FavoriteWorkoutPlans.Add(workoutPlans["test1-6"]);
                //Session.SaveOrUpdate(profile2);
                tx.Commit();
            }
        }
Пример #6
0
 static AdminService()
 {
     ObjectsConverter.Configure();
 }