Beispiel #1
0
        public void NullTermAsciiToStrings_WorksOnExpectedData(params string[] testStrings)
        {
            List <byte> testData = new List <byte>();

            foreach (var str in testStrings)
            {
                testData.AddRange(System.Text.Encoding.ASCII.GetBytes(str.ToCharArray()));
                testData.Add(0);
            }
            string[] output = ELFUtility.NullTermAsciiToStrings(testData.ToArray());
            output.Should().BeEquivalentTo(testStrings);
        }
Beispiel #2
0
 public void NullTermAsciiToStrings_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => ELFUtility.NullTermAsciiToStrings(null));
 }
Beispiel #3
0
 public void NullTermAsciiToStrings_ThrowsArgumentExceptionForInvalidData(byte[] data)
 {
     Assert.Throws <ArgumentException>(() => ELFUtility.NullTermAsciiToStrings(data));
 }