Пример #1
0
        // [TestCase(typeof(CircularDependencyInModelError))]
        public void TestError(Type type)
        {
            var serializer = new ReflectionSerializersFactory(new SimpleTypesCatalog());
            var activator  = new ReflectionRdActivator(serializer, null);
            var exception  = Assert.Throws <Assertion.AssertionException>(() => activator.Activate(type));

            Console.WriteLine(exception);
        }
Пример #2
0
        public void TestActivation()
        {
            var serializer = new ReflectionSerializersFactory(new SimpleTypesCatalog());
            var activator  = new ReflectionRdActivator(serializer, null);
            var model      = activator.Activate <ModelCalls>();

            Assert.NotNull(model);
            Assert.NotNull(model.Rpc1);
            Assert.NotNull(model.Rpc2);
        }
Пример #3
0
        public void TestActivation2()
        {
            var serializer = new ReflectionSerializersFactory(new SimpleTypesCatalog());
            var activator  = new ReflectionRdActivator(serializer, null);
            var model      = activator.Activate <RootModel>();

            Assert.NotNull(model);
            Assert.NotNull(model.EmptyOK);
            Assert.NotNull(model.FieldsNotNullOk);
            Assert.NotNull(model.FieldsNullableOk);
            Assert.Null(model.Nested); // nested models not supported anymore
            Assert.NotNull(model.PropertiesNotNullOk);
            Assert.NotNull(model.PropertiesNullOk);
        }
Пример #4
0
 public void TestActivation(Type type)
 {
     var serializer      = new ReflectionSerializersFactory(new SimpleTypesCatalog());
     var activator       = new ReflectionRdActivator(serializer, null);
     var activateRdModel = activator.Activate(type);
 }