public void Test_Get_Activities_For_Week_On_A_New_Month() { var dateOnNewMonth = new DateTime(2019, 11, 01); var month = ExampleData.GetMonthSummary(); var result = month.getActivitiesForThisWeek(month.Activites); Assert.AreEqual(1, result.Count); }
public PartialViewResult LoadCalendarPartial(DateTime date) { if (!User.Identity.IsAuthenticated) { MonthSummary exampleMonthSummary = ExampleData.GetMonthSummary(); return(PartialView("_CalendarPartial", exampleMonthSummary)); } _httpContextHelper.Context = HttpContext; string accessToken = _httpContextHelper.getAccessToken(); int stravaId = Convert.ToInt32(User.FindFirst("stravaId").Value); var user = getUpdatedUserActivities(accessToken, stravaId); MonthSummary monthSummary = new MonthSummary(date, user.VisualActivities.ToList()); return(PartialView("_CalendarPartial", monthSummary)); }