public static TSigAlgorithm GetAlgorithmByName(DomainName name) { switch (name.ToString().ToLower()) { case "hmac-md5.sig-alg.reg.int": return TSigAlgorithm.Md5; case "hmac-sha1": return TSigAlgorithm.Sha1; case "hmac-sha256": return TSigAlgorithm.Sha256; case "hmac-sha384": return TSigAlgorithm.Sha384; case "hmac-sha512": return TSigAlgorithm.Sha512; default: return TSigAlgorithm.Unknown; } }
public void DomainName_Unit_ToString_Optimal() { String firstLevelLabel = "com"; String secondLevelLabel = "vizistata"; String subDomainLabel = "www"; DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel); String expected = "www.vizistata.com"; String actual = target.ToString(); Assert.AreEqual(expected, actual); }