Skip to content

Commit 349e285

Browse files
committed
fixed testcases
1 parent 99260e1 commit 349e285

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Contentstack.Utils.Tests/DefaultRenderTest.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ public void testLinkhDocument()
178178

179179
string result = defaultRender.RenderNode("a", nodeLink, (nodes) => { return text; });
180180

181-
Assert.Equal($"<a href=\"{nodeLink.attrs["url"]}\" target=\"{nodeLink.attrs["target"]}\" title=\"{nodeLink.attrs["title"]}\" >Text To set Link</a>", result);
181+
string url = nodeLink.attrs.ContainsKey("url") ? (string)nodeLink.attrs["url"] : "";
182+
string target = nodeLink.attrs.ContainsKey("target") ? (string)nodeLink.attrs["target"] : "";
183+
string title = nodeLink.attrs.ContainsKey("title") ? (string)nodeLink.attrs["title"] : "";
184+
185+
Assert.Equal($"<a href=\"{url}\" target=\"{target}\" title=\"{title}\" >Text To set Link</a>", result);
182186
}
183187

184188
[Fact]

0 commit comments

Comments
 (0)