public void ShouldWriteSubclass() { var mapping = new SubclassMapping(); mapping.AddSubclass(new SubclassMapping()); writer.VerifyXml(mapping) .Element("subclass").Exists(); }
public override void ProcessSubclass(SubclassMapping mapping) { var subclasses = FindClosestSubclasses(mapping.Type); foreach (var provider in subclasses) mapping.AddSubclass(provider.GetSubclassMapping(new SubclassMapping())); base.ProcessSubclass(mapping); }
void GenerateNestedSubclasses(SubclassMapping mapping) { foreach (var subclassType in indetermineateSubclasses.Keys) { var subclassMapping = indetermineateSubclasses[subclassType].GetSubclassMapping(mapping.SubclassType); mapping.AddSubclass(subclassMapping); } }
public void ShouldWriteSubclass() { var mapping = new SubclassMapping(SubclassType.JoinedSubclass); mapping.AddSubclass(new SubclassMapping(SubclassType.JoinedSubclass)); writer.VerifyXml(mapping) .Element("joined-subclass").Exists(); }
public override void ProcessSubclass(SubclassMapping mapping) { var subclasses = FindClosestSubclasses(mapping.Type); foreach (var provider in subclasses) { mapping.AddSubclass(provider.GetSubclassMapping(mapping.SubclassType)); } base.ProcessSubclass(mapping); }
public override void ProcessSubclass(SubclassMapping mapping) { var subclasses = subclassProviders .Select(x => x.GetSubclassMapping(new SubclassMapping())) .Where(x => x.Type.BaseType == mapping.Type); foreach (var subclass in subclasses) mapping.AddSubclass(subclass); base.ProcessSubclass(mapping); }
public void Should_write_multiple_nestings_of_subclasses() { var subclassMapping = new SubclassMapping(); subclassMapping.AddSubclass(new SubclassMapping { Name = "Child" }); subclassMapping.Subclasses.First().AddSubclass(new SubclassMapping { Name = "Grandchild" }); _subclassWriter.VerifyXml(subclassMapping) .Element("subclass").Exists().HasAttribute("name", "Child") .Element("subclass").Exists().HasAttribute("name", "Grandchild"); }
public void ShouldWriteSubclass() { var mapping = new SubclassMapping(SubclassType.JoinedSubclass); mapping.AddSubclass(new SubclassMapping(SubclassType.JoinedSubclass)); writer.VerifyXml(mapping) .Element("joined-subclass").Exists(); }
public void SubclassesCollectionHasSameCountAsMapping() { mapping.AddSubclass(new SubclassMapping(SubclassType.Subclass)); inspector.Subclasses.Count().ShouldEqual(1); }
public void ShouldWriteSubclass() { var mapping = new SubclassMapping(); mapping.AddSubclass(new SubclassMapping()); writer.VerifyXml(mapping) .Element("subclass").Exists(); }
public void Should_write_the_subclasses() { var subclassMapping = new SubclassMapping(); subclassMapping.AddSubclass(new SubclassMapping()); _subclassWriter.VerifyXml(subclassMapping) .Element("subclass").Exists(); }