Ejemplo n.º 1
0
        public void DecodingTooManyBytesTest(byte[] input, bool expectedOutput)
        {
            var memStream = new MemoryStream();

            memStream.Write(input, 0, input.Length);
            memStream.Seek(0, SeekOrigin.Begin);
            Assert.AreEqual(expectedOutput, ClientDataEncoder.DecodeGenerateResponse(memStream));
        }
Ejemplo n.º 2
0
        public void EncodingTest(byte[] expectedOutput, ushort numberOfCodesToGenerate, int codeLength)
        {
            var requestAsBytes = ClientDataEncoder.EncodeGenerateRequest(numberOfCodesToGenerate, codeLength);

            Assert.AreEqual(expectedOutput[0], requestAsBytes[0]);
            Assert.AreEqual(expectedOutput[1], requestAsBytes[1]);
            Assert.AreEqual(expectedOutput[2], requestAsBytes[2]);
        }