public void should_deserialize_Empty_xml_to_empty_object()
        {
            var deserializer = new StringDeserializer();

            var testObject = deserializer.DeserializeApiResponse <TestEmptyObject>(EmptyXmlResponse);

            Assert.That(testObject, Is.Not.Null);
        }
        public void should_deserialize_well_formed_xml()
        {
            var deserializer = new StringDeserializer();

            var testObject = deserializer.DeserializeApiResponse <TestObject>(TestObjectXmlResponse);

            Assert.That(testObject, Is.Not.Null);
            Assert.That(testObject.Id, Is.EqualTo(1));
            Assert.That(testObject.Name, Is.EqualTo("A big test object"));

            Assert.That(testObject.StringList, Is.Not.Null);
            Assert.That(testObject.StringList.Count, Is.GreaterThan(0));

            Assert.That(testObject.ObjectList, Is.Not.Null);
            Assert.That(testObject.ObjectList.Count, Is.GreaterThan(0));
        }
        public void should_throw_exception_when_deserialize_into_wrong_type_such_as_one_that_is_not_wrapped_in_a_response_tag()
        {
            var deserializer = new StringDeserializer();

            Assert.Throws <UnexpectedXmlContentException>(() => deserializer.DeserializeApiResponse <Status>(TestObjectXmlResponse.Replace("response", "rexponse")));
        }
        public void should_throw_exception_when_deserialize_into_wrong_type()
        {
            var deserializer = new StringDeserializer();

            Assert.Throws <UnexpectedXmlContentException>(() => deserializer.DeserializeApiResponse <Status>(TestObjectXmlResponse));
        }