public void TestHexConversion() { string dataToHex = ALL_CHARS; string hex = HexConversion.TextToHex(dataToHex); string plainText = HexConversion.HexToText(hex); Assert.AreEqual(hex, "61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 31 32 33 34 35 36 37 38 39 30 2d 3d 21 40 23 24 25 5e 26 2a 28 29 5f 2b 5c 5d 5b 7c 7d 7b 27 3b 3a 2f 2e 2c 3f 3e 3c 22", "HexConversion the hex value does not match predetermined hex value"); Assert.AreEqual(dataToHex, plainText, "Inpux Hex does not match initial value"); }
public void TestHex() { var hexConversion = new HexConversion(); var path = "./TestRead/test.hex"; var contents = File.ReadAllText(path); var loadedPalette = hexConversion.FromContents(contents); Assert.IsTrue(Enumerable.SequenceEqual(_expectedColors, loadedPalette.Colors)); Assert.AreEqual("palette", loadedPalette.Title); Assert.AreEqual(string.Empty, loadedPalette.Description); }
static void Main(string[] args) { List <string> list = FileHandler.ReadFile(args[0]); FileHandler.WriteFile(HexConversion.compute(list, (int)ConversionOptions.dec), args[1]); }