public void Should_multiply_reps_by_appropriate_level_for_each_workout_when_there_are_mixed_levels() { var physioWorkout = new PhysioCircuit(); physioWorkout.LogList.Add(new CircuitLog { Variant = Variant.Normal, Level = 1, NumberOfRoundsPerformed = 3 }); physioWorkout.LogList.Add(new CircuitLog { Variant = Variant.Normal, Level = 2, NumberOfRoundsPerformed = 3 }); physioWorkout.LogList.Add(new CircuitLog { Variant = Variant.Normal, Level = 3, NumberOfRoundsPerformed = 3 }); var numberOfCrunches = physioWorkout.GetTotalCrunchesPerformed(); var numberOfBridges = physioWorkout.GetTotalBridgesPerformed(); var numberOfSquats = physioWorkout.GetTotalSquatsPerformed(); Assert.AreEqual(225, numberOfCrunches); Assert.AreEqual(135, numberOfBridges); Assert.AreEqual(135, numberOfSquats); }
private void CreateCurrentWeekStatsSection(List <Workout> workouts, LinearLayout currentWeekStatsLayout) { var logsForWeek = _circuitLogService.SelectRunningWeeksLogsFromWorkouts(); var physioCircuitWorkout = new PhysioCircuit(); physioCircuitWorkout.LogList.AddRange(logsForWeek); var totalBridgesForWeek = physioCircuitWorkout.GetTotalBridgesPerformed(); var totalSquatsForWeek = physioCircuitWorkout.GetTotalSquatsPerformed(); var averageBridgesPerDay = totalBridgesForWeek / 7; var averageSquatsPerDay = totalSquatsForWeek / 7; var orderedListOfPointsForWeek = logsForWeek .GroupBy(x => x.WorkoutDate.DayOfWeek) .Select(x => x.Sum(y => y.GetPoints())) .OrderBy(x => x).ToList(); var daysWithWorkoutsCount = orderedListOfPointsForWeek.Count(); var daysWithoutWorkoutsCount = 7 - daysWithWorkoutsCount; currentWeekStatsLayout.AddView(new TextView(currentWeekStatsLayout.Context) { Text = $"{totalBridgesForWeek} bridges this week! {averageBridgesPerDay} on average per day!" }); currentWeekStatsLayout.AddView(new TextView(currentWeekStatsLayout.Context) { Text = $"{totalSquatsForWeek} squats this week! {averageSquatsPerDay} on average per day!" }); }
public void Should_multiply_reps_by_level_for_level_2() { var log = new CircuitLog { Variant = Variant.Normal, Level = 2, NumberOfRoundsPerformed = 3 }; var physioWorkout = new PhysioCircuit(); physioWorkout.LogList.Add(log); var numberOfCrunches = physioWorkout.GetTotalCrunchesPerformed(); var numberOfBridges = physioWorkout.GetTotalBridgesPerformed(); var numberOfSquats = physioWorkout.GetTotalSquatsPerformed(); Assert.AreEqual(75, numberOfCrunches); Assert.AreEqual(45, numberOfBridges); Assert.AreEqual(45, numberOfSquats); }