public void TestGetEnumSelectListItemGivenGenericThatIsNotAnEnum() { const int not = 1; var testHtml = new TestHtml <IndexViewModel>(); Assert.Throws <ArgumentException>(() => testHtml.GetEnumSelectListItem <IndexViewModel, int>(not)); }
public void TestGetEnumSelectListItemGivenEnumWithNoDisplayNameSet() { var testHtml = new TestHtml <IndexViewModel>(); var expected = new SelectListItem("TestWithoutDisplayName", "2"); var actual = testHtml.GetEnumSelectListItem <IndexViewModel, IsAnEnum>(IsAnEnum.TestWithoutDisplayName); expected.IsSame(actual); }
public void TestGetEnumSelectListItemGivenGenericValueThatIsNotAnEnum() { var testHtml = new TestHtml <IndexViewModel>(); Assert.Throws <ArgumentException>(() => testHtml.GetEnumSelectListItem <IndexViewModel, IsAnEnum>((IsAnEnum)3)); }