public void Setup() { ExplicitMappings = new Mock <IExplicitMappings>(MockBehavior.Strict); EntityContext = new Mock <IEntityContext>(MockBehavior.Strict); ExplicitMappings.Setup(instance => instance.Set(It.IsAny <IEntityMapping>(), It.IsAny <Iri>())); ConverterProvider = new Mock <IConverterProvider>(MockBehavior.Strict); EventArgs = new UnmappedPropertyEventArgs(EntityContext.Object, new Statement(new Iri("subject"), new Iri("predicate"), "test")); EntityContextExtensions.ExplicitMappings[EntityContext.Object] = ExplicitMappings.Object; EntityContextExtensions.MappingVisitors = Array.Empty <IMappingProviderVisitor>(); EntityContextExtensions.ConverterProvider = ConverterProvider.Object; EntityContextExtensions.QIriMappings = Array.Empty <QIriMapping>(); TheTest(); }
private void OnUnmappedPropertyEncountered(object sender, UnmappedPropertyEventArgs e) { switch (e.Statement.Predicate.ToString()) { case "temp:name": e.OfEntity <IUnmappedProduct>(config => config .WithProperty(typeof(string), "TempName") .MappedTo(e.Statement.Predicate, e.Statement.Graph).WithDefaultConverter()); break; case "temp:label": e.OfEntity <IUnmappedProduct>(config => config .WithProperty(typeof(string), "TempLabel") .MappedTo(e.Statement.Predicate, e.Statement.Graph).WithDefaultConverter()); break; } }