public virtual void EnumPropertyWithChoicesAndDefault() { ITestObject foo = NewTestObject <Foo>(); ITestProperty sex1 = foo.GetPropertyByName("Sex4").AssertValueIsEqual("Male"); ITestNaked[] values = sex1.GetChoices(); Assert.AreEqual(2, values.Count()); }
public virtual void EnumPropertyWithChoices() { ITestObject foo = NewTestObject <Foo>(); ITestProperty sex1 = foo.GetPropertyByName("Sex3").AssertValueIsEqual("Male"); ITestNaked[] values = sex1.GetChoices(); Assert.AreEqual(2, values.Count()); Assert.AreEqual("Male", values.ElementAt(0).NakedObject.TitleString()); Assert.AreEqual("Female", values.ElementAt(1).NakedObject.TitleString()); }
public virtual void IntPropertyAsEnum() { ITestObject foo = NewTestObject <Foo>(); ITestProperty sex1 = foo.GetPropertyByName("Sex5"); ITestNaked[] values = sex1.GetChoices(); Assert.AreEqual(4, values.Count()); Assert.AreEqual("Female", values.ElementAt(0).NakedObject.TitleString()); Assert.AreEqual("Male", values.ElementAt(1).NakedObject.TitleString()); Assert.AreEqual("Not Specified", values.ElementAt(2).NakedObject.TitleString()); Assert.AreEqual("Unknown", values.ElementAt(3).NakedObject.TitleString()); }
public virtual void EnumPropertyByteEnum() { ITestObject foo = NewTestObject <Foo>(); ITestProperty sex1 = foo.GetPropertyByName("Hair Colour1"); ITestNaked[] values = sex1.GetChoices(); Assert.AreEqual(5, values.Count()); Assert.AreEqual("Black", values.ElementAt(0).NakedObject.TitleString()); Assert.AreEqual("White", values.ElementAt(4).NakedObject.TitleString()); sex1.AssertFieldEntryIsValid("Brunette"); sex1.AssertFieldEntryInvalid("Fair"); }
public virtual void EnumPropertyBasic() { ITestObject foo = NewTestObject <Foo>(); ITestProperty sex1 = foo.GetPropertyByName("Sex1"); ITestNaked[] values = sex1.GetChoices(); Assert.AreEqual(4, values.Count()); Assert.AreEqual("Female", values.ElementAt(0).NakedObject.TitleString()); Assert.AreEqual("Male", values.ElementAt(1).NakedObject.TitleString()); Assert.AreEqual("Not Specified", values.ElementAt(2).NakedObject.TitleString()); Assert.AreEqual("Unknown", values.ElementAt(3).NakedObject.TitleString()); sex1.AssertFieldEntryIsValid("Male"); sex1.AssertFieldEntryInvalid("Man"); }