public void SaveNewDefinition_DataInfo()
        {
            var         profile = (ProfileDTO)profiles[0].Tag;
            SessionData data    = CreateNewSession(profile, ClientInformation);

            var oldHash = profiles[0].DataInfo.SupplementsCycleDefinitionHash;

            var definition = new SupplementCycleDefinitionDTO();

            definition.Name     = "name";
            definition.Language = "en";
            var week = new SupplementCycleWeekDTO();

            definition.Weeks.Add(week);
            var dosage = new SupplementCycleDosageDTO();

            dosage.Supplement = supplements[0].Map <SuplementDTO>();
            week.Dosages.Add(dosage);
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                service.SaveSupplementsCycleDefinition(data.Token, definition);
            });

            var dbProfile = Session.Get <Profile>(profile.GlobalId);

            Assert.AreNotEqual(oldHash, dbProfile.DataInfo.SupplementsCycleDefinitionHash);
        }
Beispiel #2
0
        private SupplementCycleDefinition createCreating2DTDefinition()
        {
            var supplementDTO   = supplement.Map <SuplementDTO>();
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Language = "en";
            cycleDefinition.Name     = "creatine cycle";
            SupplementCycleWeekDTO trainingWeek = new SupplementCycleWeekDTO();

            trainingWeek.Name           = "Training week";
            trainingWeek.CycleWeekStart = 1;
            trainingWeek.CycleWeekEnd   = 4;
            cycleDefinition.Weeks.Add(trainingWeek);
            SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO();

            dosageDto.Dosage      = 5;
            dosageDto.DosageType  = Service.V2.Model.DosageType.Grams;
            dosageDto.Supplement  = supplementDTO;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 5;
            dosageDto.DosageType  = Service.V2.Model.DosageType.Grams;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Supplement  = supplementDTO;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeSleep;
            trainingWeek.Dosages.Add(dosageDto);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
        public void UpdateDefinition()
        {
            var         profile = (ProfileDTO)profiles[0].Tag;
            SessionData data    = CreateNewSession(profile, ClientInformation);

            var definition = new SupplementCycleDefinitionDTO();

            definition.Name     = "name";
            definition.Language = "en";
            var week = new SupplementCycleWeekDTO();

            definition.Weeks.Add(week);
            var dosage = new SupplementCycleDosageDTO();

            dosage.Supplement = supplements[0].Map <SuplementDTO>();
            week.Dosages.Add(dosage);
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                definition = service.SaveSupplementsCycleDefinition(data.Token, definition);
            });
            definition.Name = "test1";
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                definition = service.SaveSupplementsCycleDefinition(data.Token, definition);
            });
            Assert.AreEqual(1, Session.QueryOver <SupplementCycleDefinition>().RowCount());
            Assert.AreEqual(1, Session.QueryOver <SupplementCycleDosage>().RowCount());
            Assert.AreEqual(1, Session.QueryOver <SupplementCycleWeek>().RowCount());
            Assert.AreEqual("test1", definition.Name);
        }
        public void SaveNewDefinition()
        {
            var         profile = (ProfileDTO)profiles[0].Tag;
            SessionData data    = CreateNewSession(profile, ClientInformation);

            var definition = new SupplementCycleDefinitionDTO();

            definition.Name     = "name";
            definition.Language = "en";
            var week = new SupplementCycleWeekDTO();

            definition.Weeks.Add(week);
            var dosage = new SupplementCycleDosageDTO();

            dosage.Supplement = supplements[0].Map <SuplementDTO>();
            week.Dosages.Add(dosage);
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                TimerService.UtcNow = DateTime.UtcNow.Date.AddDays(1);
                var savedDefinition = service.SaveSupplementsCycleDefinition(data.Token, definition);
                Assert.AreEqual(profile.GlobalId, savedDefinition.Profile.GlobalId);
                Assert.AreEqual(DateTime.UtcNow.Date.AddDays(1), savedDefinition.CreationDate);
                definition.CreationDate = savedDefinition.CreationDate;
                UnitTestHelper.CompareObjects(definition, savedDefinition, true);

                var dbDef = Session.Get <SupplementCycleDefinition>(savedDefinition.GlobalId);
                UnitTestHelper.CompareObjects(savedDefinition, dbDef.Map <SupplementCycleDefinitionDTO>());
            });
        }
        private SupplementCycleDefinition createCycle()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "bcaa";
            cycleDefinition.Language = "en";
            SupplementCycleWeekDTO week = new SupplementCycleWeekDTO();

            week.Name           = "Training week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 4;
            cycleDefinition.Weeks.Add(week);
            SupplementCycleDosageDTO dosageDto = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.CardioTrainingDay, DosageType.Grams, TimeType.OnEmptyStomach);

            dosageDto.DosageUnit = DosageUnit.ON10KgWight;
            week.Dosages.Add(dosageDto);
            dosageDto            = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.CardioTrainingDay, DosageType.Grams, TimeType.BeforeWorkout);
            dosageDto.DosageUnit = DosageUnit.ON10KgWight;
            week.Dosages.Add(dosageDto);
            dosageDto            = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.CardioTrainingDay, DosageType.Grams, TimeType.AfterWorkout);
            dosageDto.DosageUnit = DosageUnit.ON10KgWight;
            week.Dosages.Add(dosageDto);

            dosageDto            = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.NonTrainingDay, DosageType.Grams, TimeType.OnEmptyStomach);
            dosageDto.DosageUnit = DosageUnit.ON10KgWight;
            week.Dosages.Add(dosageDto);


            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
        public void UpdateDefinition_RemoveCanBeIllegalSupplement()
        {
            var         profile = (ProfileDTO)profiles[0].Tag;
            SessionData data    = CreateNewSession(profile, ClientInformation);

            var definition = new SupplementCycleDefinitionDTO();

            definition.Name     = "name";
            definition.Language = "en";
            var week = new SupplementCycleWeekDTO();

            definition.Weeks.Add(week);
            var dosage = new SupplementCycleDosageDTO();

            dosage.Supplement = supplements[0].Map <SuplementDTO>();
            week.Dosages.Add(dosage);

            dosage            = new SupplementCycleDosageDTO();
            dosage.Supplement = supplements[1].Map <SuplementDTO>();
            week.Dosages.Add(dosage);
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                definition = service.SaveSupplementsCycleDefinition(data.Token, definition);
            });
            definition.Name = "test1";
            definition.Weeks[0].Dosages.RemoveAt(1);
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                definition = service.SaveSupplementsCycleDefinition(data.Token, definition);
            });
            Assert.AreEqual(false, definition.CanBeIllegal);
        }
        public void SaveNewDefinition_WithCanBeIllegalSupplements()
        {
            var         profile = (ProfileDTO)profiles[0].Tag;
            SessionData data    = CreateNewSession(profile, ClientInformation);

            var definition = new SupplementCycleDefinitionDTO();

            definition.Name     = "name";
            definition.Language = "en";
            var week = new SupplementCycleWeekDTO();

            definition.Weeks.Add(week);
            var dosage = new SupplementCycleDosageDTO();

            dosage.Supplement = supplements[0].Map <SuplementDTO>();
            week.Dosages.Add(dosage);
            dosage            = new SupplementCycleDosageDTO();
            dosage.Supplement = supplements[1].Map <SuplementDTO>();
            week.Dosages.Add(dosage);
            RunServiceMethod(delegate(InternalBodyArchitectService service)
            {
                TimerService.UtcNow = DateTime.UtcNow.Date.AddDays(1);
                var savedDefinition = service.SaveSupplementsCycleDefinition(data.Token, definition);
                Assert.AreEqual(true, savedDefinition.CanBeIllegal);
            });
        }
        private SupplementCycleDefinition createCreatingStormAndShockTherapyDefinition()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "storm and shock therapy";
            cycleDefinition.Language = "en";
            SupplementCycleWeekDTO trainingWeek = new SupplementCycleWeekDTO();

            trainingWeek.Name           = "Training week";
            trainingWeek.CycleWeekStart = 1;
            trainingWeek.CycleWeekEnd   = 6;
            cycleDefinition.Weeks.Add(trainingWeek);
            SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO();

            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = shock;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeWorkout;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.AfterWorkout;
            trainingWeek.Dosages.Add(dosageDto);

            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            trainingWeek.Dosages.Add(dosageDto);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
 protected SupplementCycleDosageDTO CreateDosage(decimal dosageValue, SuplementDTO supplement, SupplementCycleDayRepetitions repetitions = SupplementCycleDayRepetitions.OnceAWeek, Service.V2.Model.DosageType dosageType = Service.V2.Model.DosageType.MiliGrams, Service.V2.Model.TimeType timeType = Service.V2.Model.TimeType.NotSet)
 {
     var dosage = new SupplementCycleDosageDTO();
     dosage.Dosage = dosageValue;
     dosage.DosageType = dosageType;
     dosage.Repetitions = repetitions;
     dosage.Supplement = supplement;
     dosage.TimeType =  timeType;
     return dosage;
 }
        private SupplementCycleDefinition createCycle()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "creatine cycle";
            cycleDefinition.Language = "en";
            SupplementCycleWeekDTO week = new SupplementCycleWeekDTO();

            week.Name           = "Training week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 1;
            cycleDefinition.Weeks.Add(week);
            SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO();

            dosageDto.Dosage      = 400;
            dosageDto.DosageType  = Service.V2.Model.DosageType.MiliGrams;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek;
            dosageDto.Supplement  = nandrolon;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            week.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 500;
            dosageDto.DosageType  = Service.V2.Model.DosageType.MiliGrams;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek;
            dosageDto.Supplement  = testosteron;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 2;
            week.CycleWeekEnd   = 16;
            cycleDefinition.Weeks.Add(week);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 400;
            dosageDto.DosageType  = Service.V2.Model.DosageType.MiliGrams;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek;
            dosageDto.Supplement  = nandrolon;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            week.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 250;
            dosageDto.DosageType  = Service.V2.Model.DosageType.MiliGrams;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek;
            dosageDto.Supplement  = testosteron;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            week.Dosages.Add(dosageDto);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
Beispiel #11
0
        private SupplementCycleDefinition createCycleForRepetitions1()
        {
            var suppleDTO       = supplement.Map <SuplementDTO>();
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "sterydy";
            cycleDefinition.Language = "en";
            SupplementCycleWeekDTO week = new SupplementCycleWeekDTO();

            week.Name           = "Training week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 2;
            week.IsRepetitable  = false;
            cycleDefinition.Weeks.Add(week);
            SupplementCycleDosageDTO dosageDto = CreateDosageDTO(400, suppleDTO);

            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 3;
            week.CycleWeekEnd   = 4;
            week.IsRepetitable  = false;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(401, suppleDTO);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 5;
            week.CycleWeekEnd   = 6;
            week.IsRepetitable  = false;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(300, suppleDTO);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 7;
            week.CycleWeekEnd   = 7;
            week.IsRepetitable  = false;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(410, suppleDTO);
            week.Dosages.Add(dosageDto);


            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
        public void AddDosage()
        {
            var week   = SelectedWeek;
            var dosage = new SupplementCycleDosageDTO();

            week.Dosages.Add(dosage);
            var parent    = (SupplementsCycleWeekViewModel)SelectedItem;
            var viewModel = new SupplementsCycleDosageViewModel(parent, dosage);

            parent.Dosages.Add(viewModel);
            parent.IsExpanded    = true;
            viewModel.IsSelected = true;
            IsModified           = true;
        }
Beispiel #13
0
        private SupplementCycleDefinition createCycle()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "bcaa";
            cycleDefinition.Language = "en";
            SupplementCycleWeekDTO week = new SupplementCycleWeekDTO();

            week.Name           = "Training week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 4;
            cycleDefinition.Weeks.Add(week);

            SupplementCycleDosageDTO dosageDto = CreateDosageDTO(5, bcaa, Service.V2.Model.SupplementCycleDayRepetitions.EveryDay, Service.V2.Model.DosageType.Tablets, Service.V2.Model.TimeType.OnEmptyStomach);

            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(5, bcaa, Service.V2.Model.SupplementCycleDayRepetitions.EveryDay, Service.V2.Model.DosageType.Tablets, Service.V2.Model.TimeType.BeforeWorkout);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(5, bcaa, Service.V2.Model.SupplementCycleDayRepetitions.EveryDay, Service.V2.Model.DosageType.Tablets, Service.V2.Model.TimeType.AfterWorkout);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 1;
            cycleDefinition.Weeks.Add(week);

            var measurement = new SupplementCycleMeasurementDTO();

            measurement.Repetitions = Service.V2.Model.SupplementCycleDayRepetitions.OnceAWeek;
            week.Dosages.Add(measurement);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 5;
            week.CycleWeekEnd   = 5;
            cycleDefinition.Weeks.Add(week);
            measurement             = new SupplementCycleMeasurementDTO();
            measurement.Repetitions = Service.V2.Model.SupplementCycleDayRepetitions.OnceAWeek;
            week.Dosages.Add(measurement);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
Beispiel #14
0
        public void CycleDefinition_WithoutLanguage()
        {
            var res        = CreateSupplement("Sup");
            var definition = new SupplementCycleDefinitionDTO();

            definition.Name = "test";
            var week = new SupplementCycleWeekDTO();

            definition.Weeks.Add(week);
            var dosage = new SupplementCycleDosageDTO();

            dosage.Supplement = res.Map <SuplementDTO>();
            week.Dosages.Add(dosage);


            IBodyArchitectAccessService service = CreateServiceProxy(AddressHeader.CreateAddressHeader("APIKey", "", "EB17BC2A-94FD-4E65-8751-15730F69E7F5"));

            var sessionData = service.Login(ClientInformation, "test_user", "pwd".ToSHA1Hash());

            service.SaveSupplementsCycleDefinition(sessionData.Token, definition);
        }
        private SupplementCycleDefinition createCycle()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "Pojedyńczy Trenbolon";
            cycleDefinition.Language = "pl";
            SupplementCycleWeekDTO week = new SupplementCycleWeekDTO();

            week.Name           = "Training week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 10;
            cycleDefinition.Weeks.Add(week);
            SupplementCycleDosageDTO dosageDto = CreateDosageDTO(100, trebolon, SupplementCycleDayRepetitions.EveryDay);

            week.Dosages.Add(dosageDto);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
        private SupplementCycleDefinition createCycle()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "sterydy";
            cycleDefinition.Language = "en";
            SupplementCycleWeekDTO week = new SupplementCycleWeekDTO();

            week.Name           = "Training week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 4;
            cycleDefinition.Weeks.Add(week);
            SupplementCycleDosageDTO dosageDto = CreateDosageDTO(400, nandrolon);

            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(750, testosteron);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(30, metandienon, SupplementCycleDayRepetitions.EveryDay);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 5;
            week.CycleWeekEnd   = 8;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(400, nandrolon);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(750, testosteron);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 9;
            week.CycleWeekEnd   = 12;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(400, nandrolon);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(750, testosteron);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(30, metandienon, SupplementCycleDayRepetitions.EveryDay);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 13;
            week.CycleWeekEnd   = 16;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(400, nandrolon);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(750, testosteron);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 17;
            week.CycleWeekEnd   = 20;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(400, nandrolon);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(750, testosteron);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(30, metandienon, SupplementCycleDayRepetitions.EveryDay);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Training week";
            week.CycleWeekStart = 21;
            week.CycleWeekEnd   = 24;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(400, nandrolon);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(750, testosteron);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings);
            week.Dosages.Add(dosageDto);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
        private SupplementCycleDefinition createCycle()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "Terapia po cyklu stosowania kuracji testosteronem enantat";
            cycleDefinition.Language = "pl";
            SupplementCycleWeekDTO week = new SupplementCycleWeekDTO();

            week.Name           = "Week";
            week.CycleWeekStart = 1;
            week.CycleWeekEnd   = 1;
            cycleDefinition.Weeks.Add(week);
            SupplementCycleDosageDTO dosageDto = CreateDosageDTO(500, hcg, SupplementCycleDayRepetitions.EveryDay);

            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Week";
            week.CycleWeekStart = 2;
            week.CycleWeekEnd   = 2;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(500, hcg, SupplementCycleDayRepetitions.EveryDay);
            week.Dosages.Add(dosageDto);
            dosageDto         = CreateDosageDTO(50, clomifen, SupplementCycleDayRepetitions.EveryDay);
            dosageDto.Comment = "Około 6 dni po ostatniej iniekcji 300 mg Clomifenu, następnie 50 mg dziennie, po tym 40 mg dziennie";
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Week";
            week.CycleWeekStart = 3;
            week.CycleWeekEnd   = 3;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(50, clomifen, SupplementCycleDayRepetitions.EveryDay);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(25, kreatyna, SupplementCycleDayRepetitions.EveryDay, DosageType.Grams);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(40, efedryna, SupplementCycleDayRepetitions.StrengthTrainingDay, timeType: TimeType.BeforeWorkout);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.BeforeWorkout);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.AfterWorkout);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Week";
            week.CycleWeekStart = 4;
            week.CycleWeekEnd   = 8;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(50, clomifen, SupplementCycleDayRepetitions.EveryDay);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(10, kreatyna, SupplementCycleDayRepetitions.EveryDay, DosageType.Grams);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(40, efedryna, SupplementCycleDayRepetitions.StrengthTrainingDay, timeType: TimeType.BeforeWorkout);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.BeforeWorkout);
            week.Dosages.Add(dosageDto);
            dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.AfterWorkout);
            week.Dosages.Add(dosageDto);

            week                = new SupplementCycleWeekDTO();
            week.Name           = "Week";
            week.CycleWeekStart = 9;
            week.CycleWeekEnd   = 10;
            cycleDefinition.Weeks.Add(week);
            dosageDto = CreateDosageDTO(10, kreatyna, SupplementCycleDayRepetitions.EveryDay, DosageType.Grams);
            week.Dosages.Add(dosageDto);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }
 public SupplementsCycleDosageViewModel(SupplementsCycleWeekViewModel parentDay, SupplementCycleDosageDTO entry) : base(parentDay, entry)
 {
     this.entry = entry;
     Update();
 }
Beispiel #19
0
        private SupplementCycleDefinition createCreatingStormAndShockTherapy_InsreaseServingsEveryWeekDefinition()
        {
            var cycleDefinition = new SupplementCycleDefinitionDTO();

            cycleDefinition.Name     = "storm and shock therapy";
            cycleDefinition.Language = "en";
            SupplementCycleWeekDTO trainingWeek = new SupplementCycleWeekDTO();

            trainingWeek.Name = "Training week";
            cycleDefinition.Weeks.Add(trainingWeek);
            trainingWeek.CycleWeekStart = 1;
            trainingWeek.CycleWeekEnd   = 1;
            SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO();

            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.AfterWorkout;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = shock;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeWorkout;
            trainingWeek.Dosages.Add(dosageDto);

            SupplementCycleWeekDTO nonTrainingWeek = new SupplementCycleWeekDTO();

            nonTrainingWeek.Name = "Non training week";
            cycleDefinition.Weeks.Add(nonTrainingWeek);
            nonTrainingWeek.CycleWeekStart = 1;
            nonTrainingWeek.CycleWeekEnd   = 1;
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            nonTrainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            nonTrainingWeek.Dosages.Add(dosageDto);

            //week 2
            trainingWeek      = new SupplementCycleWeekDTO();
            trainingWeek.Name = "Training week";
            cycleDefinition.Weeks.Add(trainingWeek);
            trainingWeek.CycleWeekStart = 2;
            trainingWeek.CycleWeekEnd   = 2;
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.AfterWorkout;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1.5M;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Supplement  = shock;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeWorkout;
            trainingWeek.Dosages.Add(dosageDto);

            nonTrainingWeek = new SupplementCycleWeekDTO();
            nonTrainingWeek.CycleWeekStart = 2;
            nonTrainingWeek.CycleWeekEnd   = 2;
            nonTrainingWeek.Name           = "Non training week";
            cycleDefinition.Weeks.Add(nonTrainingWeek);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            nonTrainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            nonTrainingWeek.Dosages.Add(dosageDto);

            //week 3
            trainingWeek      = new SupplementCycleWeekDTO();
            trainingWeek.Name = "Training week";
            cycleDefinition.Weeks.Add(trainingWeek);
            trainingWeek.CycleWeekStart = 3;
            trainingWeek.CycleWeekEnd   = 3;
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.AfterWorkout;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Dosage      = 2;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = shock;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeWorkout;
            trainingWeek.Dosages.Add(dosageDto);

            nonTrainingWeek = new SupplementCycleWeekDTO();
            nonTrainingWeek.CycleWeekStart = 3;
            nonTrainingWeek.CycleWeekEnd   = 3;
            nonTrainingWeek.Name           = "Non training week";
            cycleDefinition.Weeks.Add(nonTrainingWeek);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            nonTrainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            nonTrainingWeek.Dosages.Add(dosageDto);

            //week 4
            trainingWeek      = new SupplementCycleWeekDTO();
            trainingWeek.Name = "Training week";
            cycleDefinition.Weeks.Add(trainingWeek);
            trainingWeek.CycleWeekStart = 4;
            trainingWeek.CycleWeekEnd   = 4;
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.AfterWorkout;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 2.5M;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Supplement  = shock;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeWorkout;
            trainingWeek.Dosages.Add(dosageDto);

            nonTrainingWeek = new SupplementCycleWeekDTO();
            nonTrainingWeek.CycleWeekStart = 4;
            nonTrainingWeek.CycleWeekEnd   = 4;
            nonTrainingWeek.Name           = "Non training week";
            cycleDefinition.Weeks.Add(nonTrainingWeek);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            nonTrainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            nonTrainingWeek.Dosages.Add(dosageDto);

            //week 5
            trainingWeek      = new SupplementCycleWeekDTO();
            trainingWeek.Name = "Training week";
            cycleDefinition.Weeks.Add(trainingWeek);
            trainingWeek.CycleWeekStart = 5;
            trainingWeek.CycleWeekEnd   = 5;
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.AfterWorkout;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 3;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = shock;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeWorkout;
            trainingWeek.Dosages.Add(dosageDto);

            nonTrainingWeek = new SupplementCycleWeekDTO();
            nonTrainingWeek.CycleWeekStart = 5;
            nonTrainingWeek.CycleWeekEnd   = 5;
            nonTrainingWeek.Name           = "Non training week";
            cycleDefinition.Weeks.Add(nonTrainingWeek);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            nonTrainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            nonTrainingWeek.Dosages.Add(dosageDto);

            //week 6
            trainingWeek      = new SupplementCycleWeekDTO();
            trainingWeek.Name = "Training week";
            cycleDefinition.Weeks.Add(trainingWeek);
            trainingWeek.CycleWeekStart = 6;
            trainingWeek.CycleWeekEnd   = 6;
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.AfterWorkout;
            trainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay;
            dosageDto.Dosage      = 3.5M;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = shock;
            dosageDto.TimeType    = Service.V2.Model.TimeType.BeforeWorkout;
            trainingWeek.Dosages.Add(dosageDto);

            nonTrainingWeek = new SupplementCycleWeekDTO();
            nonTrainingWeek.CycleWeekStart = 6;
            nonTrainingWeek.CycleWeekEnd   = 6;
            nonTrainingWeek.Name           = "Non training week";
            cycleDefinition.Weeks.Add(nonTrainingWeek);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Supplement  = storm;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.TimeType    = Service.V2.Model.TimeType.OnEmptyStomach;
            nonTrainingWeek.Dosages.Add(dosageDto);
            dosageDto             = new SupplementCycleDosageDTO();
            dosageDto.Dosage      = 1;
            dosageDto.DosageType  = DosageType.Servings;
            dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay;
            dosageDto.Supplement  = storm;
            dosageDto.TimeType    = Service.V2.Model.TimeType.NotSet;
            nonTrainingWeek.Dosages.Add(dosageDto);

            var definition = cycleDefinition.Map <SupplementCycleDefinition>();

            definition.Profile = profiles[0];
            Session.Save(definition);
            return(definition);
        }