public void decConversion() { // Using the value 23 which is 10111, 17 //Simple conversion tests Assert.AreEqual("23", NumberConvert.ConvertToBase("10111", 2, 10)); Assert.AreEqual("23", NumberConvert.ConvertToBase("17", 16, 10)); }
public void hexLength() { Assert.AreNotEqual("17", NumberConvert.ConvertToBase("10111", 2, 16, 10)); Assert.AreEqual("0017", NumberConvert.ConvertToBase("23", 10, 16, 4)); Assert.AreEqual("17", NumberConvert.ConvertToBase("10111", 2, 16, 1)); }
public void binLength() { Assert.AreNotEqual("10111", NumberConvert.ConvertToBase("17", 16, 2, 10)); Assert.AreEqual("0000010111", NumberConvert.ConvertToBase("17", 16, 2, 10)); Assert.AreEqual("10111", NumberConvert.ConvertToBase("17", 16, 2, 4)); }
public void binConversion() { Assert.AreEqual("10111", NumberConvert.ConvertToBase("23", 10, 2, 5)); Assert.AreEqual("10111", NumberConvert.ConvertToBase("17", 16, 2, 5)); }