コード例 #1
0
        public void TryEncode_SmallerOutput_Fails(Base16 encoder)
        {
            var input  = new byte[4];
            var output = new char[0];

            Assert.IsFalse(encoder.TryEncode(input, output, out int numCharsWritten));
            Assert.AreEqual(0, numCharsWritten);
        }
コード例 #2
0
ファイル: Base16Test.cs プロジェクト: ssg/SimpleBase
        public void TryEncode_SmallerOutput_Fails(Base16 encoder)
        {
            var input  = new byte[4];
            var output = new char[0];

            Assert.That(encoder.TryEncode(input, output, out int numCharsWritten), Is.False);
            Assert.That(numCharsWritten, Is.EqualTo(0));
        }
コード例 #3
0
        public void TryEncode_RegularInput_Succeeds(Base16 encoder, byte[] input, string expectedOutput)
        {
            var output = new char[input.Length * 2];

            Assert.IsTrue(encoder.TryEncode(input, output, out int numCharsWritten));
            Assert.AreEqual(output.Length, numCharsWritten);
            Assert.AreEqual(expectedOutput, new string(output));
        }
コード例 #4
0
ファイル: Base16Test.cs プロジェクト: ssg/SimpleBase
        public void TryEncode_RegularInput_Succeeds(Base16 encoder, byte[] input, string expectedOutput)
        {
            var output = new char[input.Length * 2];

            Assert.That(encoder.TryEncode(input, output, out int numCharsWritten), Is.True);
            Assert.That(numCharsWritten, Is.EqualTo(output.Length));
            Assert.That(new string(output), Is.EqualTo(expectedOutput));
        }