public void WhenPassedNull_GetComment_ReturnsEmpty() { XmlCommentFile commentFile = CreateXmlCommentFile("myfile.xml"); SetFileExistsAndLoadXml(commentFile); XmlCodeComment result = commentFile.GetComment(null); Assert.AreSame(XmlCodeComment.Empty, result); }
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); }
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); }
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); }
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); }