Example #1
0
        public void WhenPassedNull_GetComment_ReturnsEmpty()
        {
            XmlCommentFile commentFile = CreateXmlCommentFile("myfile.xml");

            SetFileExistsAndLoadXml(commentFile);

            XmlCodeComment result = commentFile.GetComment(null);

            Assert.AreSame(XmlCodeComment.Empty, result);
        }
Example #2
0
        public void WhenCRefValidButNoData_GetComment_ReturnsEmpty()
        {
            XmlCommentFile commentFile = CreateXmlCommentFile("myfile.xml");

            SetFileExistsAndLoadXml(commentFile);
            CRefPath crefPath = CRefPath.Parse("T:Nowhere.DoesntExist");

            XmlCodeComment result = commentFile.GetComment(crefPath);

            Assert.AreSame(XmlCodeComment.Empty, result);
        }
Example #3
0
        public void WhenNotLoaded_GetComment_ReturnsEmpty()
        {
            XmlCommentFile commentFile = CreateXmlCommentFile("myfile.xml");

            _fileSystem.Setup(p => p.FileExists(It.IsAny <string>())).Returns(true);
            CRefPath crefPath = CRefPath.Parse("T:Namespace.TypeName");

            XmlCodeComment result = commentFile.GetComment(crefPath);

            Assert.AreSame(XmlCodeComment.Empty, result);
        }
Example #4
0
        public void WhenCRefIsValid_GetComment_GetsCorrectComment()
        {
            XmlCommentFile commentFile = CreateXmlCommentFile("myfile.xml");

            SetFileExistsAndLoadXml(commentFile);
            CRefPath crefPath = CRefPath.Parse("T:Namespace.MyType");

            XmlCodeComment result = commentFile.GetComment(crefPath);

            Assert.AreNotSame(XmlCodeComment.Empty, result);
            Assert.AreEqual(1, result.Elements.Count);
        }
Example #5
0
        public void WhenCRefIsErrorPath_GetComment_ReturnsEmpty()
        {
            XmlCommentFile commentFile = CreateXmlCommentFile("myfile.xml");

            SetFileExistsAndLoadXml(commentFile);
            CRefPath crefPath = new CRefPath();

            crefPath.PathType = CRefTypes.Error;

            XmlCodeComment result = commentFile.GetComment(crefPath);

            Assert.AreSame(XmlCodeComment.Empty, result);
        }