public void AddingMapper_ForSameTypeTwice_ThrowsException() { var configuration = new EntityMapperConfiguration(); configuration.AddMapper <ExampleModelWithMapping1, MapperForExampleModel1>(); Assert.Throws <MapperAlreadyRegisteredForTypeException>(() => { configuration.AddMapper <ExampleModelWithMapping1, MapperForExampleModel1>(); }); }
public void AddingMapper_WithMapperProvided_AddsItToTheMapperDictionary() { var configuration = new EntityMapperConfiguration(); configuration.AddMapper <ExampleModelWithMapping1, MapperForExampleModel1>(); Assert.Single(configuration.Mappers); Assert.Equal( expected: typeof(MapperForExampleModel1), actual: configuration.Mappers[typeof(ExampleModelWithMapping1)]); }
public override void Configure(EntityMapperConfiguration cfg) { cfg .AddMapper <ExampleModelWithMapping1, MapperForExampleModel1>() .AddMapper <ExampleModelWithMapping1, MapperForExampleModel1>(); }
public void Constructing_InitializesMappersDictionary() { var configuration = new EntityMapperConfiguration(); Assert.NotNull(configuration.Mappers); }
public override void Configure(EntityMapperConfiguration cfg) { }