예제 #1
0
        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");
        }
예제 #2
0
        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");
        }