Exemplo n.º 1
0
        public void ToHex_Should_ReturnExpectedResult_When_StringProvided()
        {
            // Arrange
            var expected = "0104000000000005150000002E43AC40C085385D07E53B2B";
            var sid      = "S-1-5-21-1085031214-1563985344-725345543";

            // Act
            var actual = Sid.ToHex(sid);

            // Assert
            Assert.Equal(expected, actual);
        }
Exemplo n.º 2
0
        public void ToHex_Should_ReturnExpectedResult_When_ByteProvided()
        {
            // Arrange
            var expected = "0104000000000005150000002E43AC40C085385D07E53B2B";
            var sid      = new byte[]
            {
                0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
                0x15, 0x00, 0x00, 0x00, 0x2E, 0x43, 0xAC, 0x40,
                0xC0, 0x85, 0x38, 0x5D, 0x07, 0xE5, 0x3B, 0x2B
            };

            // Act
            var actual = Sid.ToHex(sid);

            // Assert
            Assert.Equal(expected, actual);
        }