public void XmlNodesFromStringPassedToAssociator() { var matcher = MockRepository.GenerateMock<IDocumentationXmlMatcher>(); var parser = new AssemblyXmlParser(matcher, StubDocModel, StubDocMembers); var assemblies = new Assembly[0]; var capturedArgsForDocumentMembers = matcher.CaptureArgumentsFor(x => x.DocumentMembers(null, null), onCall => onCall.Return(null)); parser.CreateDocumentModel(assemblies, Xml); capturedArgsForDocumentMembers.Second<IEnumerable<XmlNode>>().Count().ShouldNotEqual(0); }
public void ShouldPassAssocationsToTransformer() { var model = MockRepository.GenerateMock<IDocumentModel>(); var parser = new AssemblyXmlParser(StubDocXmlMatcher, model, StubDocMembers); var assemblies = new Assembly[0]; var associations = new IDocumentationMember[0]; StubDocXmlMatcher.Stub(x => x.DocumentMembers(null, null)) .IgnoreArguments() .Return(associations); parser.CreateDocumentModel(assemblies, new[] {""}); model.AssertWasCalled(x => x.Create(associations)); }
public void TypesFromAssembliesPassedToAssociator() { var matcher = MockRepository.GenerateMock<IDocumentationXmlMatcher>(); var parser = new AssemblyXmlParser(matcher, StubDocModel, StubDocMembers); var assemblies = new[] {typeof(First).Assembly, typeof(AssemblyXmlParserTests).Assembly}; var members = DocMembers(typeof(First), typeof(Second)); StubDocMembers.Stub(x => x.GetMembersForDocumenting(null)) .IgnoreArguments() .Return(members); var capturedArgsForDocumentMembers = matcher.CaptureArgumentsFor(x => x.DocumentMembers(null, null), onCall => onCall.Return(null)); parser.CreateDocumentModel(assemblies, new[] { "" }); capturedArgsForDocumentMembers.First<IEnumerable<IDocumentationMember>>().ShouldBeSameAs(members); }
public void TypesFromAssembliesPassedToAssociator() { var matcher = MockRepository.GenerateMock<IDocumentationXmlMatcher>(); var parser = new AssemblyXmlParser(matcher, StubDocModel, StubDocMembers); var assemblies = new[] {typeof(First).Assembly, typeof(AssemblyXmlParserTests).Assembly}; var members = DocMembers(typeof(First), typeof(Second)); StubDocMembers.Stub(x => x.GetMembersForDocumenting(null)) .IgnoreArguments() .Return(members); parser.CreateDocumentModel(assemblies, new[] {""}); matcher.AssertWasCalled( x => x.DocumentMembers(null, null), x => x.IgnoreArguments() .Constraints( CIs.Equal(members), CIs.Anything())); }
public void XmlNodesFromStringPassedToAssociator() { var matcher = MockRepository.GenerateMock<IDocumentationXmlMatcher>(); var parser = new AssemblyXmlParser(matcher, StubDocModel, StubDocMembers); var assemblies = new Assembly[0]; parser.CreateDocumentModel(assemblies, Xml); matcher.AssertWasCalled( x => x.DocumentMembers(null, null), x => x.IgnoreArguments() .Constraints( CIs.Anything(), CList.Count(CIs.GreaterThan(0)))); }