예제 #1
0
        public void MemberOrder_SimpleTestItem_ReturnsMemberOrder()
        {
            var testItemType = typeof(SimpleTestItem);
            var value1       = testItemType.GetMember("Value1")[0];
            var value2       = testItemType.GetMember("Value2")[0];

            Assert.AreEqual(-1, FormatterUtils.MemberOrder(value1), "Value1 should have order -1.");
            Assert.AreEqual(-1, FormatterUtils.MemberOrder(value2), "Value2 should have order -1.");
        }
예제 #2
0
        public void MemberOrder_SimpleTestItem_ReturnsMemberOrder()
        {
            var testItemType = typeof(SimpleTestItem);
            var value1       = testItemType.GetMember("Value1")[0];
            var value2       = testItemType.GetMember("Value2")[0];

            FormatterUtils.MemberOrder(value1).Should().Be(-1, "Value1 should have order -1.");
            FormatterUtils.MemberOrder(value2).Should().Be(-1, "Value2 should have order -1.");
        }
예제 #3
0
        public void MemberOrder_ComplexTestItem_ReturnsMemberOrder()
        {
            var testItemType = typeof(ComplexTestItem);
            var value1       = testItemType.GetMember("Value1")[0];
            var value2       = testItemType.GetMember("Value2")[0];
            var value3       = testItemType.GetMember("Value3")[0];
            var value4       = testItemType.GetMember("Value4")[0];
            var value5       = testItemType.GetMember("Value5")[0];
            var value6       = testItemType.GetMember("Value6")[0];

            Assert.AreEqual(-1, FormatterUtils.MemberOrder(value1), "Value1 should have order -1.");
            Assert.AreEqual(2, FormatterUtils.MemberOrder(value2), "Value2 should have order 2.");
            Assert.AreEqual(1, FormatterUtils.MemberOrder(value3), "Value3 should have order 1.");
            Assert.AreEqual(-2, FormatterUtils.MemberOrder(value4), "Value4 should have order -2.");
            Assert.AreEqual(-1, FormatterUtils.MemberOrder(value5), "Value5 should have order -1.");
            Assert.AreEqual(-1, FormatterUtils.MemberOrder(value6), "Value6 should have order -1.");
        }
예제 #4
0
        public void MemberOrder_ComplexTestItem_ReturnsMemberOrder()
        {
            var testItemType = typeof(ComplexTestItem);
            var value1       = testItemType.GetMember("Value1")[0];
            var value2       = testItemType.GetMember("Value2")[0];
            var value3       = testItemType.GetMember("Value3")[0];
            var value4       = testItemType.GetMember("Value4")[0];
            var value5       = testItemType.GetMember("Value5")[0];
            var value6       = testItemType.GetMember("Value6")[0];

            FormatterUtils.MemberOrder(value1).Should().Be(-1, "Value1 should have order -1.");
            FormatterUtils.MemberOrder(value2).Should().Be(2, "Value2 should have order 2.");
            FormatterUtils.MemberOrder(value3).Should().Be(1, "Value3 should have order 1.");
            FormatterUtils.MemberOrder(value4).Should().Be(-2, "Value4 should have order -2.");
            FormatterUtils.MemberOrder(value5).Should().Be(-1, "Value5 should have order -1.");
            FormatterUtils.MemberOrder(value6).Should().Be(-1, "Value6 should have order -1.");
        }