private async void OnPreviousMonthClick(object sender, EventArgs e) { var result = await Task.Run(() => { _monthContainer.Previous(); var days = _monthContainer.Days; var monthName = _monthContainer.GetName(); return(days, monthName); }); MonthName.Text = result.monthName; RecycleDays(result.days); }
public CalendarView() { InitializeComponent(); _monthContainer = new MonthContainer(DateTime.Today); BindableLayout.SetItemsSource(CalendarDaysContainer, _monthContainer.Days); BindableLayout.SetItemsSource(CalendarDaysOfWeekContainer, _monthContainer.DaysOfWeek); MonthName.Text = _monthContainer.GetName(); }
public void MonthContainerShouldHaveAName() { var dateTime = new DateTime(2020, 7, 9); var monthContainer = new MonthContainer(dateTime); var result = monthContainer.GetName(); var dateTimeName = dateTime.ToString("MMMM yyyy"); Assert.AreEqual(dateTimeName, result); }
public void MonthContainerShouldNavigateToNextMonth() { var dateTime = new DateTime(2020, 11, 9); var monthContainer = new MonthContainer(dateTime); monthContainer.Next(); var dateTimeName = monthContainer._month.MonthDateTime.ToString("MMMM yyyy"); Assert.AreEqual(dateTimeName, monthContainer.GetName()); Assert.AreEqual(31, monthContainer.Days.Count(day => day is {}));
public void MonthContainerShouldNavigateToPreviousMonth() { var dateTime = new DateTime(2021, 1, 1); var monthContainer = new MonthContainer(dateTime); monthContainer.Previous(); var dateTimeName = monthContainer._month.MonthDateTime.ToString("MMMM"); Assert.AreEqual(dateTimeName, monthContainer.GetName()); }
public void MonthContainerShouldNavigateToNextMonth() { var dateTime = new DateTime(2020, 12, 9); var monthContainer = new MonthContainer(dateTime); monthContainer.Next(); var dateTimeName = monthContainer._month.MonthDateTime.ToString("MMMM"); Assert.AreEqual(dateTimeName, monthContainer.GetName()); }