public void Url_AllGoMonoUrl() { UrlMembershipCondition umc = new UrlMembershipCondition("http://www.example.com/*"); Assert.AreEqual("http://www.example.com/*", umc.Url, "Url"); Assert.AreEqual("Url - http://www.example.com/*", umc.ToString(), "ToString"); UrlMembershipCondition umc2 = (UrlMembershipCondition)umc.Copy(); Assert.AreEqual(umc.Url, umc2.Url, "Copy.Url"); Assert.AreEqual(umc.GetHashCode(), umc2.GetHashCode(), "Copy.GetHashCode"); SecurityElement se = umc2.ToXml(); UrlMembershipCondition umc3 = new UrlMembershipCondition("*"); umc3.FromXml(se); Assert.AreEqual(umc.Url, umc3.Url, "ToXml/FromXml"); Assert.IsTrue(umc.Equals(umc2), "Equals"); UrlMembershipCondition umc4 = new UrlMembershipCondition("http://www.example.com/"); Assert.IsTrue(umc.Equals(umc4), "Equals-*"); }
public void UrlMembershipCondition_GoMonoWebUrl() { UrlMembershipCondition umc = new UrlMembershipCondition("http://www.example.com/"); Assert.AreEqual("http://www.example.com/", umc.Url, "Url"); Assert.AreEqual("Url - http://www.example.com/", umc.ToString(), "ToString"); UrlMembershipCondition umc2 = (UrlMembershipCondition)umc.Copy(); Assert.AreEqual(umc.Url, umc2.Url, "Copy.Url"); Assert.AreEqual(umc.GetHashCode(), umc2.GetHashCode(), "Copy.GetHashCode"); SecurityElement se = umc2.ToXml(); UrlMembershipCondition umc3 = new UrlMembershipCondition("*"); umc3.FromXml(se); Assert.AreEqual(umc.Url, umc3.Url, "ToXml/FromXml"); Assert.IsTrue(umc.Equals(umc2), "Equals"); UrlMembershipCondition umc4 = new UrlMembershipCondition("http://www.example.com"); // note that a last slash is added to Url - so it's equal Assert.IsTrue(umc.Equals(umc4), "Equals-AutoAddedLastSlash"); }