Beispiel #1
0
        public void Switcher_ConstructionWithParameters()
        {
            SwitcherAttribute systemUnderTest = new SwitcherAttribute(cText, uText);

            Assert.IsNotNull(systemUnderTest);
            Assert.AreEqual(cText, systemUnderTest.CheckedText);
            Assert.AreEqual(uText, systemUnderTest.UncheckedText);
        }
Beispiel #2
0
        public void Switcher_ConstructionDefault()
        {
            SwitcherAttribute systemUnderTest = new SwitcherAttribute();

            Assert.IsNotNull(systemUnderTest);
            Assert.IsNotNull(systemUnderTest.CheckedText);
            Assert.IsNotNull(systemUnderTest.UncheckedText);
        }
Beispiel #3
0
        public void Switcher_FromMetadata()
        {
            Model model = new Model();

            SwitcherAttribute att = model.GetType().GetProperty("defaultBool").GetCustomAttribute <SwitcherAttribute>();

            Assert.IsNotNull(att);
            Assert.IsNotNull(att.CheckedText);
            Assert.IsNotNull(att.UncheckedText);

            att = model.GetType().GetProperty("customBool").GetCustomAttribute <SwitcherAttribute>();
            Assert.IsNotNull(att);
            Assert.AreEqual(cText, att.CheckedText);
            Assert.AreEqual(uText, att.UncheckedText);
        }