Beispiel #1
0
            public Task <LiveModel> M(Lifetime m)
            {
                var model = myActivator.Activate <LiveModel>();

                model.Values.Advise(m, e => ourState = e.NewValue);
                return(Task.FromResult(model));
            }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
0
 public void TestActivation(Type type)
 {
     var serializer      = new ReflectionSerializersFactory(new SimpleTypesCatalog());
     var activator       = new ReflectionRdActivator(serializer, null);
     var activateRdModel = activator.Activate(type);
 }