Пример #1
0
        public void CanPostUnregisteredType()
        {
            UnregisteredClass data = new UnregisteredClass {
                Text = "Hello"
            };
            Request request = Session.Bind(XmlEchoTemplate);

            Response <UnregisteredClass> response = request.Accept("application/xml").ContentType("application/xml").Post <UnregisteredClass>(data);

            Assert.AreEqual(data.Text, response.Body.Text);
        }
Пример #2
0
        public void CanPostUnregisteredTypeWithShorthand()
        {
            UnregisteredClass data = new UnregisteredClass {
                Text = "Hello"
            };
            Request request = Session.Bind(XmlEchoTemplate);

            Response <UnregisteredClass> response = request.AsXml().AcceptXml().Post <UnregisteredClass>(data);

            Assert.AreEqual(data.Text, response.Body.Text);
        }
Пример #3
0
        public void CanPostUnregisteredTypeUsingShorthand()
        {
            UnregisteredClass data = new UnregisteredClass {
                Text = "Hello"
            };
            Request request = Session.Bind(AnyEchoTemplate);

            using (Response <UnregisteredClass> response = request.AsJson().AcceptJson().Post <UnregisteredClass>(data))
            {
                Assert.AreEqual(data.Text, response.Body.Text);
            }
        }
Пример #4
0
 public UnregisteredParentClass(UnregisteredClass childClass)
 {
     ChildClass = childClass;
 }