コード例 #1
0
		public void WhenRegisteredAsComponentThenIsRegistered()
		{
			var inspector = new ExplicitlyDeclaredModel();
			inspector.AddAsComponent(typeof(MyComponent));

			Assert.That(inspector.IsComponent(typeof(MyComponent)), Is.True);
		}
コード例 #2
0
		public void WhenRegisteredAsComponetThenCantRegisterAsRootEntity()
		{
			var inspector = new ExplicitlyDeclaredModel();
			inspector.AddAsComponent(typeof(MyComponent));

			Assert.That(() => inspector.AddAsRootEntity(typeof(MyComponent)), Throws.TypeOf<MappingException>());
		}
コード例 #3
0
		public void WhenRegisteredAsComponetThenCantRegisterAsRootEntity()
		{
			var inspector = new ExplicitlyDeclaredModel();
			inspector.AddAsComponent(typeof(MyComponent));

			inspector.Executing(x => x.AddAsRootEntity(typeof(MyComponent))).Throws<MappingException>();
		}
コード例 #4
0
		public void WhenRegisteredAsComponentThenIsRegistered()
		{
			var inspector = new ExplicitlyDeclaredModel();
			inspector.AddAsComponent(typeof(MyComponent));

			inspector.IsComponent(typeof(MyComponent)).Should().Be.True();
		}
コード例 #5
0
		public void WhenRegisteredAsComponetThenCantRegisterAsUnionSubclass()
		{
			var inspector = new ExplicitlyDeclaredModel();
			inspector.AddAsComponent(typeof(MyComponent));

			inspector.Executing(x => x.AddAsTablePerConcreteClassEntity(typeof(MyComponent))).Throws<MappingException>();
		}
コード例 #6
0
		public void WhenRegisteredAsComponetThenCantRegisterAsUnionSubclass()
		{
			var inspector = new ExplicitlyDeclaredModel();
			inspector.AddAsComponent(typeof (MyComponent));

			Assert.That(() =>
			{
				inspector.AddAsTablePerConcreteClassEntity(typeof (MyComponent));
				inspector.IsTablePerConcreteClass(typeof (MyComponent));
			}, Throws.TypeOf<MappingException>());
		}
コード例 #7
0
		public void WhenRegisteredAsComponetThenCantRegisterAsUnionSubclass()
		{
			var inspector = new ExplicitlyDeclaredModel();
			inspector.AddAsComponent(typeof (MyComponent));

			Executing.This(() =>
			               {
			               	inspector.AddAsTablePerConcreteClassEntity(typeof (MyComponent));
			               	inspector.IsTablePerConcreteClass(typeof (MyComponent));
			               }).Should().Throw<MappingException>();
		}
コード例 #8
0
 void IModelExplicitDeclarationsHolder.AddAsComponent(System.Type type)
 {
     declaredModel.AddAsComponent(type);
 }