public void WhenExplicitlyDeclaredAsBagThenDoesNotUseSet() { var mapper = new ObjectRelationalMapper(); mapper.Patterns.Sets.Add(new BagCollectionPattern()); mapper.Bag<A>(a=> a.Others); mapper.IsBag(ForClass<A>.Property(a=> a.Others)).Should().Be.True(); mapper.IsSet(ForClass<A>.Property(a => a.NickNames)).Should().Be.True(); mapper.IsSet(ForClass<A>.Property(a => a.Set)).Should().Be.True(); }
public void WhenExplicitlyDeclaredAsBagThenDoesNotUseSet() { var mapper = new ObjectRelationalMapper(); mapper.Patterns.Sets.Add(new BagCollectionPattern()); mapper.Bag <A>(a => a.Others); mapper.IsBag(ForClass <A> .Property(a => a.Others)).Should().Be.True(); mapper.IsSet(ForClass <A> .Property(a => a.NickNames)).Should().Be.True(); mapper.IsSet(ForClass <A> .Property(a => a.Set)).Should().Be.True(); }
public void RecognizeExplicitRegisteredSetProperty() { var mapper = new ObjectRelationalMapper(); mapper.Set<A>(x => x.NickNames); var mi = typeof(A).GetProperty("NickNames"); mapper.IsSet(mi).Should().Be.True(); }
public void WhenInBaseClassThenNoRecognizeNoSetProperty() { var mapper = new ObjectRelationalMapper(); var mi = typeof(A).GetProperty("Others"); mapper.IsSet(mi).Should().Be.False(); }
public void WhenInBaseClassThenRecognizeSetProperty() { var mapper = new ObjectRelationalMapper(); var mi = typeof(B).GetProperty("Set"); mapper.IsSet(mi).Should().Be.True(); }
public void RecognizeExplicitRegisteredSetProperty() { var mapper = new ObjectRelationalMapper(); mapper.Set <A>(x => x.NickNames); var mi = typeof(A).GetProperty("NickNames"); mapper.IsSet(mi).Should().Be.True(); }