public void WhenSplittedPropertiesThenRegisterSplitGroupIds()
		{
			var inspector = new ExplicitlyDeclaredModel();
			var mapper = new ModelMapper(inspector);
			mapper.Subclass<Inherited>(map =>
			{
				map.Join("MyClassSplit1", mj =>
				{
					mj.Property(x => x.SomethingA1);
					mj.Property(x => x.SomethingA2);
				});
				map.Join("MyClassSplit2", mj =>
				{
					mj.Property(x => x.SomethingB1);
					mj.Property(x => x.SomethingB2);
				});
				map.Property(x => x.Something0);
			});

			IEnumerable<string> tablePerClassSplits = inspector.GetPropertiesSplits(typeof(Inherited));
			Assert.That(tablePerClassSplits, Is.EquivalentTo(new [] {"MyClassSplit1", "MyClassSplit2"}));
		}
		public void WhenSplittedPropertiesThenRegisterSplitGroupIds()
		{
			var inspector = new ExplicitlyDeclaredModel();
			var mapper = new ModelMapper(inspector);
			mapper.Subclass<Inherited>(map =>
			{
				map.Join("MyClassSplit1", mj =>
				{
					mj.Property(x => x.SomethingA1);
					mj.Property(x => x.SomethingA2);
				});
				map.Join("MyClassSplit2", mj =>
				{
					mj.Property(x => x.SomethingB1);
					mj.Property(x => x.SomethingB2);
				});
				map.Property(x => x.Something0);
			});

			IEnumerable<string> tablePerClassSplits = inspector.GetPropertiesSplits(typeof(Inherited));
			tablePerClassSplits.Should().Have.SameValuesAs("MyClassSplit1", "MyClassSplit2");
		}
Example #3
0
        IEnumerable <string> IModelInspector.GetPropertiesSplits(System.Type type)
        {
            IEnumerable <string> declaredResult = declaredModel.GetPropertiesSplits(type);

            return(splitsForType(type, declaredResult));
        }