Example #1
0
        public void ShouldCreateCollectionSerialiserWhenCollectionPropertyIsPassed()
        {
            DefaultSerialiserFactory   factory    = new DefaultSerialiserFactory();
            PropertyInfo               property   = typeof(Project).GetProperty("Triggers");
            ReflectorPropertyAttribute attribute  = (ReflectorPropertyAttribute)property.GetCustomAttributes(false)[0];
            IXmlSerialiser             serialiser = factory.Create(ReflectorMember.Create(property), attribute);

            Assert.AreEqual(typeof(XmlCollectionSerialiser), serialiser.GetType());
        }
Example #2
0
        public void ShouldCreateArraySerialiserWhenArrayPropertyIsPassed()
        {
            IXmlSerialiser serialiser = factory.Create(ReflectorMember.Create(typeof(ArrayTestClass).GetProperty("Elements")), attribute);

            Assert.AreEqual(typeof(XmlArraySerialiser), serialiser.GetType());
        }