public void WhenRegisteredAsComponentThenIsRegistered() { var inspector = new ExplicitlyDeclaredModel(); inspector.AddAsComponent(typeof(MyComponent)); Assert.That(inspector.IsComponent(typeof(MyComponent)), Is.True); }
public void WhenRegisteredAsComponetThenCantRegisterAsRootEntity() { var inspector = new ExplicitlyDeclaredModel(); inspector.AddAsComponent(typeof(MyComponent)); Assert.That(() => inspector.AddAsRootEntity(typeof(MyComponent)), Throws.TypeOf<MappingException>()); }
public void WhenRegisteredAsComponetThenCantRegisterAsRootEntity() { var inspector = new ExplicitlyDeclaredModel(); inspector.AddAsComponent(typeof(MyComponent)); inspector.Executing(x => x.AddAsRootEntity(typeof(MyComponent))).Throws<MappingException>(); }
public void WhenRegisteredAsComponentThenIsRegistered() { var inspector = new ExplicitlyDeclaredModel(); inspector.AddAsComponent(typeof(MyComponent)); inspector.IsComponent(typeof(MyComponent)).Should().Be.True(); }
public void WhenRegisteredAsComponetThenCantRegisterAsUnionSubclass() { var inspector = new ExplicitlyDeclaredModel(); inspector.AddAsComponent(typeof(MyComponent)); inspector.Executing(x => x.AddAsTablePerConcreteClassEntity(typeof(MyComponent))).Throws<MappingException>(); }
public void WhenRegisteredAsComponetThenCantRegisterAsUnionSubclass() { var inspector = new ExplicitlyDeclaredModel(); inspector.AddAsComponent(typeof (MyComponent)); Assert.That(() => { inspector.AddAsTablePerConcreteClassEntity(typeof (MyComponent)); inspector.IsTablePerConcreteClass(typeof (MyComponent)); }, Throws.TypeOf<MappingException>()); }
public void WhenRegisteredAsComponetThenCantRegisterAsUnionSubclass() { var inspector = new ExplicitlyDeclaredModel(); inspector.AddAsComponent(typeof (MyComponent)); Executing.This(() => { inspector.AddAsTablePerConcreteClassEntity(typeof (MyComponent)); inspector.IsTablePerConcreteClass(typeof (MyComponent)); }).Should().Throw<MappingException>(); }
void IModelExplicitDeclarationsHolder.AddAsComponent(System.Type type) { declaredModel.AddAsComponent(type); }