public DearDbaDomainMapper() { orm = new ObjectRelationalMapper(); // Remove one of not required patterns orm.Patterns.ManyToOneRelations.Remove( orm.Patterns.ManyToOneRelations.Single(p => p.GetType() == typeof(OneToOneUnidirectionalToManyToOnePattern))); orm.Patterns.PoidStrategies.Add(new NativePoidPattern()); IPatternsAppliersHolder patternsAppliers = (new SafePropertyAccessorPack()) .Merge(new OneToOneRelationPack(orm)) .Merge(new BidirectionalManyToManyRelationPack(orm)) .Merge(new BidirectionalOneToManyRelationPack(orm)) .Merge(new DiscriminatorValueAsClassNamePack(orm)) .Merge(new DearDbaTablesAndColumnsNamingPack(orm, new EnglishInflector())) .Merge(new TablePerClassPack()) .Merge(new DatePropertyByNameApplier()) .Merge(new MsSQL2008DateTimeApplier()); patternsAppliers.Merge(new DatePropertyByNameApplier()).Merge(new MsSQL2008DateTimeApplier()); mapper = new Mapper(orm, patternsAppliers); }
public void WhenSourceIsNullThenThrow() { IPatternsAppliersHolder source = null; ActionAssert.Throws <ArgumentNullException>(() => source.Merge <PropertyPath, IPropertyMapper>(null)); }
public void WhenSourceIsNullThenThrow() { IPatternsAppliersHolder source = null; Executing.This(() => source.Merge(null)).Should().Throw <ArgumentNullException>(); }