public void TestIsolationExerciseBeforeCompoud() { TrainingPlan plan = new TrainingPlan(); plan.RestSeconds = 60; plan.Name = "name"; plan.Author = "author"; plan.TrainingType = TrainingType.Split; var day = new TrainingPlanDay(); day.Name = "day1"; plan.AddDay(day); TrainingPlanEntry entryIsolated = new TrainingPlanEntry(); entryIsolated.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("01C796E2-0119-4F95-9A9A-79F2890DF658") }; day.AddEntry(entryIsolated); entryIsolated.Sets.Add(new TrainingPlanSerie(10)); TrainingPlanEntry entryCompoud = new TrainingPlanEntry(); entryCompoud.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("9934E9E3-50DC-4B34-8B67-092084894740") }; day.AddEntry(entryCompoud); entryCompoud.Sets.Add(new TrainingPlanSerie(10)); checkSingle(plan, entryIsolated, TrainingPlanCheckItemStatus.Information, "Split_IsolationExerciseBeforeCompoud"); }
public void TestTwoIsolationExerciseBeforeCompoud() { TrainingPlan plan = new TrainingPlan(); plan.RestSeconds = 60; plan.Name = "name"; plan.Author = "author"; plan.TrainingType = TrainingType.Split; var day = new TrainingPlanDay(); day.Name = "day1"; plan.AddDay(day); TrainingPlanEntry entryIsolated = new TrainingPlanEntry(); entryIsolated.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("01C796E2-0119-4F95-9A9A-79F2890DF658") }; day.AddEntry(entryIsolated); entryIsolated.Sets.Add(new TrainingPlanSerie(10)); TrainingPlanEntry secondIsolated = new TrainingPlanEntry(); secondIsolated.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("D6562C2A-BD74-46BE-8398-57B56BD698D5") }; day.AddEntry(secondIsolated); secondIsolated.Sets.Add(new TrainingPlanSerie(10)); TrainingPlanEntry entryCompoud = new TrainingPlanEntry(); entryCompoud.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("9934E9E3-50DC-4B34-8B67-092084894740") }; day.AddEntry(entryCompoud); entryCompoud.Sets.Add(new TrainingPlanSerie(10)); //Dictionary<Guid, ExerciseDTO> exerciseDtos = ObjectsConverter.ToExerciseDTO(exercises.Values).ToDictionary(t => t.GlobalId); Dictionary <Guid, ExerciseDTO> exerciseDtos = exercises.Values.Map <IList <ExerciseDTO> >().ToDictionary(t => t.GlobalId); TrainingPlanPack pack = TrainingPlanPack.Create(plan, exerciseDtos); SplitPlanChecker checker = new SplitPlanChecker(pack); var result = checker.Check(exerciseDtos); Assert.AreEqual(2, result.Results.Count); Assert.AreEqual(TrainingPlanCheckItemStatus.Information, result.Results[0].Status); Assert.AreEqual("Split_IsolationExerciseBeforeCompoud", result.Results[0].ResourceKey); Assert.AreEqual(entryIsolated.GlobalId, result.Results[0].TrainingPlanBase.GlobalId); Assert.AreEqual(TrainingPlanCheckItemStatus.Information, result.Results[1].Status); Assert.AreEqual("Split_IsolationExerciseBeforeCompoud", result.Results[1].ResourceKey); Assert.AreEqual(secondIsolated.GlobalId, result.Results[1].TrainingPlanBase.GlobalId); }
public void TestDropSetInNotOnlyLastSet() { TrainingPlan plan = new TrainingPlan(); plan.RestSeconds = 60; plan.Name = "name"; plan.Author = "author"; plan.TrainingType = TrainingType.Split; var day = new TrainingPlanDay(); day.Name = "day1"; plan.AddDay(day); TrainingPlanEntry entry = new TrainingPlanEntry(); entry.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("9934E9E3-50DC-4B34-8B67-092084894740") }; day.AddEntry(entry); entry.Sets.Add(new TrainingPlanSerie(10)); entry.Sets.Add(new TrainingPlanSerie(10)); var set1 = new TrainingPlanSerie(10); set1.DropSet = Service.V2.Model.DropSetType.IIDropSet; entry.Sets.Add(set1); var set2 = new TrainingPlanSerie(10); set2.DropSet = Service.V2.Model.DropSetType.IIDropSet; entry.Sets.Add(set2); checkSingle(plan, set1, TrainingPlanCheckItemStatus.Information, "TrainingPlan_DropSetInNotOnlyLastSet"); }
public void TestDayNameUnique() { TrainingPlan plan = new TrainingPlan(); plan.RestSeconds = 60; plan.Name = "name"; plan.Author = "author"; plan.TrainingType = TrainingType.Split; var day1 = new TrainingPlanDay(); day1.Name = "Day 1"; plan.AddDay(day1); TrainingPlanEntry entry = new TrainingPlanEntry(); entry.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("9934E9E3-50DC-4B34-8B67-092084894740") }; day1.AddEntry(entry); entry.Sets.Add(new TrainingPlanSerie(10)); var day2 = new TrainingPlanDay(); day2.Name = "Day 1"; plan.AddDay(day2); entry = new TrainingPlanEntry(); entry.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("9934E9E3-50DC-4B34-8B67-092084894740") }; day2.AddEntry(entry); entry.Sets.Add(new TrainingPlanSerie(10)); checkSingle(plan, day2, TrainingPlanCheckItemStatus.Error, "TrainingPlan_DaysName_Unique"); }
Service.V2.Model.TrainingPlans.TrainingPlan createWorkoutPlanObject(ProfileDTO profile) { var contentPlan = new Service.V2.Model.TrainingPlans.TrainingPlan(); contentPlan.Author = "rtyt"; //contentPlan.CreationDate = DateTime.Parse("06/28/2011 19:18:26"); contentPlan.Name = "rtyre"; contentPlan.Profile = profile; contentPlan.Language = "en"; TrainingPlanDay day = new TrainingPlanDay(); day.Name = "Day 1"; contentPlan.AddDay(day); TrainingPlanEntry entry = new TrainingPlanEntry(); entry.Exercise = exercise.Map <ExerciseLightDTO>(); day.AddEntry(entry); return(contentPlan); }
public void TestExerciseDoesntExist() { TrainingPlan plan = new TrainingPlan(); plan.RestSeconds = 60; plan.Name = "name"; plan.Author = "author"; plan.TrainingType = TrainingType.Split; var day = new TrainingPlanDay(); day.Name = "day1"; plan.AddDay(day); TrainingPlanEntry entry = new TrainingPlanEntry(); entry.Exercise = new ExerciseLightDTO() { GlobalId = new Guid("1134E9E3-50DC-4B34-8B67-092084894740") }; day.AddEntry(entry); entry.Sets.Add(new TrainingPlanSerie(10)); checkSingle(plan, entry, TrainingPlanCheckItemStatus.Warning, "TrainingPlan_ExerciseDoesntExist"); }