Пример #1
0
        public void TestConvertNegatedLabelRoleToNonNegatedRole()
        {
            Taxonomy tax = new Taxonomy();
            string role;
            Assert.IsTrue( tax.ConvertNegatedLabelRoleToNonNegatedRole( NEGATED, out role ), "did not convert label" );
            Assert.AreEqual( Taxonomy.LABEL, role, "did not find negated label" );

            Assert.IsTrue( tax.ConvertNegatedLabelRoleToNonNegatedRole( NEGATED_TOTAL, out role ), "did not convert totalLabel" );
            Assert.AreEqual( Taxonomy.LABEL_TOTAL, role, "did not find negated label total" );

            Assert.IsTrue( tax.ConvertNegatedLabelRoleToNonNegatedRole( NEGATED_PER_START, out role ), "did not convert periodStartLabel" );
            Assert.AreEqual( Taxonomy.LABEL_PER_START, role, "did not find negated label per start" );

            Assert.IsTrue( tax.ConvertNegatedLabelRoleToNonNegatedRole( NEGATED_PER_END, out role ), "did not convert periodEndLabel" );
            Assert.AreEqual( Taxonomy.LABEL_PER_END, role, "did not find negated label per end" );

            Assert.IsTrue( tax.ConvertNegatedLabelRoleToNonNegatedRole( null, out role ), "did not convert null label" );
            Assert.AreEqual( Taxonomy.LABEL, role, "did not find negated label" );

            Assert.IsFalse( tax.ConvertNegatedLabelRoleToNonNegatedRole( Taxonomy.LABEL, out role ), "should not find a conversion for label" );
        }