public void BlogspotWithDashTest() { string tweet = "Url: http://samsoum-us.blogspot.com/2010/05/la-censure-nuit-limage-de-notre-pays.html"; string expected = "Url: <a href=\"http://samsoum-us.blogspot.com/2010/05/la-censure-nuit-limage-de-notre-pays.html\">http://samsoum-us.blogspot.com/2010/05/la-censure-nuit-limage-de-notre-pays.html</a>"; string actual = _autolink.AutoLinkUrls(tweet); Assert.AreEqual(expected, actual); }
public void AutolinkUrls() { var failures = new List <string>(); foreach (var test in LoadTests <string>("autolink.yml", "urls")) { try { string actual = autolink.AutoLinkUrls(test.Text); Assert.AreEqual(test.Expected, actual); } catch (Exception) { failures.Add(test.Description + ": " + test.Text); } } if (failures.Any()) { Assert.Fail(string.Join("\n", failures)); } }