public void SubStrSafeWorks() { Assert.AreEqual("A", MHString.SubstringSafe("ABCDEFGH", 0, 1), "t1"); Assert.AreEqual(string.Empty, MHString.SubstringSafe("ABCDEFGH", -1, 1), "t2"); Assert.AreEqual(string.Empty, MHString.SubstringSafe("ABCDEFGH", 99, 0), "t3"); Assert.AreEqual(string.Empty, MHString.SubstringSafe("ABCDEFGH", 99, 99), "t4"); Assert.AreEqual("ABCDEFGH", MHString.SubstringSafe("ABCDEFGH", 0, 99), "t5"); Assert.AreEqual(string.Empty, MHString.SubstringSafe("", 0, 99), "t6"); Assert.AreEqual(string.Empty, MHString.SubstringSafe("", 1, 1), "t7"); }
public void SubStrSafeRaisesException() { string x = MHString.SubstringSafe("ABCDEFGH", 0, -1); }