public AcceptVisitor ( IMappingModelVisitor visitor ) : void | ||
visitor | IMappingModelVisitor | |
Résultat | void |
public void ShouldPassClassmappingsToTheVisitor() { var hibMap = new HibernateMapping(); var classMap = new ClassMapping(); hibMap.AddClass(classMap); var visitor = MockRepository.GenerateMock<IMappingModelVisitor>(); visitor.Expect(x => x.Visit(classMap)); hibMap.AcceptVisitor(visitor); visitor.VerifyAllExpectations(); }
public void ShouldPassClassmappingsToTheVisitor() { // FakeItEasy calls ToString methods, which ends up in NullPointer // if Type attribute is not the AttributeStore var attributeStore = new AttributeStore(); attributeStore.Set("Type", 0, typeof(object)); var hibMap = new HibernateMapping(); var classMap = new ClassMapping(attributeStore); hibMap.AddClass(classMap); var visitor = A.Fake<IMappingModelVisitor>(); hibMap.AcceptVisitor(visitor); A.CallTo(() => visitor.Visit(classMap)).MustHaveHappened(); }
public void ApplyVisitors(HibernateMapping rootMapping) { foreach (var visitor in _visitors) rootMapping.AcceptVisitor(visitor); }