Ejemplo n.º 1
0
        public void DumpObjectWithValueTypeTest()
        {
            var valueTest = new ObjectWithValueTypeTest();
            var dump = _dumper.Dump(valueTest);

            Assert.NotNull(dump, "Dump shall return a DumpLevel instance.");
            Assert.AreEqual(null, dump.Value, "Dump value shall be null.");
            Assert.AreEqual(typeof(ObjectWithValueTypeTest), dump.Type, "Dump type shall be a ObjectWithValueTypeTest type.");
            Assert.AreEqual(2, dump.Count(), "Dump children count shall be 2.");
            Assert.AreEqual(0, dump.Level, "Dump level count shall be 0.");
            var children = new List<DumpLevel>(dump);
            Assert.AreEqual(2, children.Count, "Dump IEnumerable copy shall be count 2 items.");

            Assert.AreEqual("PublicProperty", children[0].Header, "First children header shall be 'PublicProperty'.");
            Assert.AreEqual(typeof(string), children[0].Type, "First children type shall be a string.");
            Assert.AreEqual("publicProp", children[0].Value, "First children value shall be 'publicProp'.");
            Assert.AreEqual(1, children[0].Level, "First children level shall be 1.");

            Assert.AreEqual("PublicProperty2", children[1].Header, "Second children header shall be 'PublicProperty'.");
            Assert.AreEqual(typeof(decimal?), children[1].Type, "Second children type shall be a decimal?.");
            Assert.AreEqual(null, children[1].Value, "Second children value shall be null.");
            Assert.AreEqual(1, children[1].Level, "Second children level shall be 1.");
        }
Ejemplo n.º 2
0
 public ObjectWithObjectTest()
 {
     PublicProperty = "publicProp";
     Instance = new ObjectWithValueTypeTest();
 }