本文整理汇总了C#中Appointment.OccursOnDate方法的典型用法代码示例。如果您正苦于以下问题:C# Appointment.OccursOnDate方法的具体用法?C# Appointment.OccursOnDate怎么用?C# Appointment.OccursOnDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Appointment
的用法示例。
在下文中一共展示了Appointment.OccursOnDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppOccursOnDateTomorrow
public void AppOccursOnDateTomorrow()
{
// Arrange
DateTime tomorrow = DateTime.Now.AddDays(1);
Appointment testApp = new Appointment {Start = tomorrow};
// Act
bool onDate = testApp.OccursOnDate(DateTime.Now);
// Assert
Assert.IsFalse(onDate, "The appointment does occur on this date! It should not!");
}
示例2: AppOccursOnDateNow
public void AppOccursOnDateNow()
{
// Arrange
DateTime now = DateTime.Now;
Appointment testApp = new Appointment() { Start = now };
// Act
bool onDate = testApp.OccursOnDate(now);
// Assert
Assert.IsTrue(onDate, "The appointment does not occur on this date! It should!");
}
示例3: TestOnDateRecurringWeek
public void TestOnDateRecurringWeek()
{
// Arrange
Appointment testApp = new Appointment
{
Start = DateTime.Now,
Recurring = true,
Recurrences = 2,
Frequency = "Weekly"
};
DateTime timeNow = DateTime.Now;
DateTime timeWeek = DateTime.Now.AddDays(7);
// Act
bool ocurrsNow = testApp.OccursOnDate(timeNow);
bool ocurrsWeek = testApp.OccursOnDate(timeWeek);
// Assert
Assert.IsTrue(ocurrsNow, "The appointment should have ocurred!");
Assert.IsTrue(ocurrsWeek, "The appointment should have ocurred!");
}
示例4: TestOnDateRecurringYear
public void TestOnDateRecurringYear()
{
// Arrange
Appointment testApp = new Appointment
{
Start = DateTime.Now,
Recurring = true,
Recurrences = 2,
Frequency = "Yearly"
};
DateTime timeNow = DateTime.Now;
DateTime timeYear = DateTime.Now.AddYears(1);
// Act
bool ocurrsNow = testApp.OccursOnDate(timeNow);
bool ocurrsYear = testApp.OccursOnDate(timeYear);
// Assert
Assert.IsTrue(ocurrsNow, "The appointment should have ocurred!");
Assert.IsTrue(ocurrsYear, "The appointment should have ocurred!");
}
示例5: TestOnDateRecurringMonth
public void TestOnDateRecurringMonth()
{
// Arrange
Appointment testApp = new Appointment
{
Start = DateTime.Now,
Recurring = true,
Recurrences = 2,
Frequency = "Monthly"
};
DateTime timeNow = DateTime.Now;
DateTime timeMonth = DateTime.Now.AddMonths(1);
// Act
bool ocurrsNow = testApp.OccursOnDate(timeNow);
bool ocurrsMonth = testApp.OccursOnDate(timeMonth);
// Assert
Assert.IsTrue(ocurrsNow, "The appointment should have ocurred!");
Assert.IsTrue(ocurrsMonth, "The appointment should have ocurred!");
}