public void NoLen_ZeroLenArray() { byte[] arr = { }; Debug.Assert(0 == arr.Length, "!WAS: " + arr.Length); string result = BluesoleilUtils.FromNameString(arr); Assert.AreEqual(string.Empty, result); }
public void NoLen_OnePadding() { byte[] arr = AppendZeros(ToArray("abcd"), 1); Debug.Assert(5 == arr.Length, "!WAS: " + arr.Length); string result = BluesoleilUtils.FromNameString(arr); Assert.AreEqual("abcd", result); }
public void NoLen_NoPadding() { byte[] arr = ToArray("abcd"); Debug.Assert(4 == arr.Length, "!WAS: " + arr.Length); string result = BluesoleilUtils.FromNameString(arr); Assert.AreEqual("abcd", result); }
public void Len_Normal() { byte[] arr = AppendZeros(ToArray("abcd"), 4); Debug.Assert(8 == arr.Length, "!WAS: " + arr.Length); string result = BluesoleilUtils.FromNameString(arr, 6); Assert.AreEqual("abcd", result); }
public void NoLen_Utf8CharInString() { byte[] arr = AppendZeros(Prepend(new byte[] { 0xC3, 0x81 }, ToArray("bcd")), 4); Debug.Assert(9 == arr.Length, "!WAS: " + arr.Length); string result = BluesoleilUtils.FromNameString(arr); Assert.AreEqual("\u00C1bcd", result); }
public void NoLen_OnlyManyZeros() { byte[] arr = { 0, 0, 0, 0, 0, 0, 0, 0 }; Debug.Assert(8 == arr.Length, "!WAS: " + arr.Length); string result = BluesoleilUtils.FromNameString(arr); Assert.AreEqual(string.Empty, result); }