Exemple #1
0
        public IMsBuildElementHelp Convert(IXmlHelp xmlHelp)
        {
            IMsBuildElementHelp msBuildElementHelp = new MsBuildElementHelp();
            XmlHelpParagraphToMsBuildElementHelpParagraphConverter converter =
                new XmlHelpParagraphToMsBuildElementHelpParagraphConverter();

            foreach (var xmlHelpParagraph in xmlHelp)
            {
                msBuildElementHelp.Add(converter.Convert(xmlHelpParagraph));
            }

            return(msBuildElementHelp);
        }
        public void Add_ShouldPassThroughInvocationToWrappedImplementation()
        {
            Mock <IMsBuildElementHelpParagraph> itemMock = new Mock <IMsBuildElementHelpParagraph>();

            itemMock.Setup(i => i.Name).Returns("A");

            Mock <IList <IMsBuildElementHelpParagraph> > listMock = new Mock <IList <IMsBuildElementHelpParagraph> >();
            MsBuildElementHelp elementHelp = new MsBuildElementHelp(listMock.Object);

            elementHelp.Add(itemMock.Object);

            listMock.Verify(l => l.Add(It.Is <IMsBuildElementHelpParagraph>(i => i.Name.Equals("A"))),
                            Times.Exactly(1));
        }