Example #1
0
 public void ShouldHandleNullAndReturnNull()
 {
     Assert.Null(OidParser.ReadFromBytes(null));
 }
Example #2
0
        public void ShouldHandleIncorrectlyTerminatedData()
        {
            var oid = OidParser.ReadFromBytes(new byte[] { 6, 8, 42, 134, 72, 206, 61, 3, 1, 255 });

            Assert.Null(oid);
        }
Example #3
0
        public void ShouldHandleIncorrectLengthCheck()
        {
            var oid = OidParser.ReadFromBytes(new byte[] { 6, 9, 42, 134, 72, 206, 61, 3, 1, 7 });

            Assert.Null(oid);
        }
Example #4
0
        public void ShouldHandleValidValue()
        {
            var oid = OidParser.ReadFromBytes(new byte[] { 6, 8, 42, 134, 72, 206, 61, 3, 1, 7 });

            Assert.Equal("1.2.840.10045.3.1.7", oid.Value);
        }
Example #5
0
 public void ShouldHandleLengthTooShortEvenWithCorrectPreamble()
 {
     Assert.Null(OidParser.ReadFromBytes(new byte[] { 6 }));
 }
Example #6
0
 public void ShouldHandleEmptyArrayAndReturnNull()
 {
     Assert.Null(OidParser.ReadFromBytes(new byte[0]));
 }