public void MaxTest() { Calendar.NET.Calendar c = new Calendar.NET.Calendar(); int i = c.Max(30, 31, 33, 32) + 5; Assert.AreEqual(i, 38); }
public void NumberOfWeeksTest() { Calendar.NET.Calendar c = new Calendar.NET.Calendar(); int weeks = c.NumberOfWeeks(2017, 5); Assert.AreEqual(weeks, 5); }
public void LastDayOfWeekInMonthTest() { Calendar.NET.Calendar c = new Calendar.NET.Calendar(); DateTime d = new DateTime(2017, 5, 1); //1st May 2017 Assert.AreEqual(c.LastDayOfWeekInMonth(d, d.DayOfWeek), DateTime.Parse("5/29/2017 12:00:00 AM")); }
public void GetFinalBackColorTest() { Calendar.NET.Calendar c = new Calendar.NET.Calendar(); c.BackColor = Color.White; c.GetFinalBackColor(); Assert.AreEqual(c.BackColor, Color.White); }
public void PresetHolidaysTest() { Calendar.NET.Calendar c = new Calendar.NET.Calendar(); c.GetEvents().Clear(); c.PresetHolidays(); List <IEvent> events = c.GetEvents(); Assert.AreEqual(events[0].EventText, "April Fools Day"); }
private void Doc_PrintPage(object sender, PrintPageEventArgs e) { Size s = calendar1.Size; Calendar.NET.Calendar current = calendar1; double rate = current.Width / 600; current.Width = 600; current.Height = Convert.ToInt32(current.Height / rate); float x = e.MarginBounds.Left; float y = e.MarginBounds.Top; Bitmap bmp = new Bitmap(current.Width, current.Height); current.DrawToBitmap(bmp, new Rectangle(0, 0, current.Width, current.Height)); e.Graphics.DrawImage((Image)bmp, x, y); calendar1.Size = s; }
public void AddEventTest() { Calendar.NET.Calendar c = new Calendar.NET.Calendar(); c.GetEvents().Clear(); var exerciseEvent = new CustomEvent { StartDate = DateTime.Now, EndDate = DateTime.Now, RecurringFrequency = RecurringFrequencies.Monthly, EventLengthInHours = 1, Alert = 1, EventText = "event1", EventFont = new Font(FontFamily.GenericSansSerif, 12.0f, FontStyle.Regular) }; c.AddEvent(exerciseEvent, false); Assert.AreEqual(c.GetEvents().Count, 1); }
public void CalendarInitTest() { Calendar.NET.Calendar c = new Calendar.NET.Calendar(); Assert.AreEqual(c.CalendarView, CalendarViews.Month); }