public Task <LiveModel> M(Lifetime m) { var model = myActivator.Activate <LiveModel>(); model.Values.Advise(m, e => ourState = e.NewValue); return(Task.FromResult(model)); }
// [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); }
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); }
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); }
public void TestActivation(Type type) { var serializer = new ReflectionSerializersFactory(new SimpleTypesCatalog()); var activator = new ReflectionRdActivator(serializer, null); var activateRdModel = activator.Activate(type); }