Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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()));
        }
Exemplo n.º 5
0
        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))));
        }