本文整理匯總了C#中NerdDinner.Models.Dinner.IsValid方法的典型用法代碼示例。如果您正苦於以下問題:C# Dinner.IsValid方法的具體用法?C# Dinner.IsValid怎麽用?C# Dinner.IsValid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NerdDinner.Models.Dinner
的用法示例。
在下文中一共展示了Dinner.IsValid方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Dinner_Should_Not_Be_Valid_When_Some_Properties_Incorrect
public void Dinner_Should_Not_Be_Valid_When_Some_Properties_Incorrect()
{
//Arrange
Dinner dinner = new Dinner()
{
Title = "Test title",
Country = ""
};
// Act
bool isValid = dinner.IsValid();
//Assert
Assert.IsFalse(isValid);
}
示例2: Dinner_Should_Be_Valid_When_All_Properties_Correct
public void Dinner_Should_Be_Valid_When_All_Properties_Correct()
{
//Arrange
Dinner dinner = new Dinner
{
Title = "Test title",
EventDate = DateTime.Now,
HostedBy = "ScottGu",
Address = "One Microsoft Way",
Country = "USA",
Latitude = 93,
Longitude = -92,
};
// Act
bool isValid = dinner.IsValid();
//Assert
Assert.IsTrue(isValid);
}