Exemplo n.º 1
0
        public void PdfNullClass_WriteToMethodWithStreamParameter_WritesCorrectValueToParameterWhenParameterIsNotNull()
        {
            PdfNull testObject = PdfNull.Value;

            using MemoryStream testParam = new MemoryStream();

            testObject.WriteTo(testParam);

            using MemoryStream expected = new MemoryStream(Encoding.ASCII.GetBytes("null "));
            AssertionHelpers.AssertSameElements(expected, testParam);
        }
Exemplo n.º 2
0
        public void PdfNullClass_WriteToMethodWithListParameter_WritesCorrectValueToParameterWhenParameterIsNotNull()
        {
            PdfNull     testObject = PdfNull.Value;
            List <byte> testParam  = new List <byte>();

            testObject.WriteTo(testParam);

            List <byte> expected = Encoding.ASCII.GetBytes("null ").ToList();

            AssertionHelpers.AssertSameElements(expected, testParam);
        }
Exemplo n.º 3
0
        public void PdfIntegerClass_WriteToMethodWithListParameter_WritesCorrectValueToList()
        {
            int         testObjectValue = _rnd.Next(int.MinValue, int.MaxValue);
            PdfInteger  testObject      = new PdfInteger(testObjectValue);
            List <byte> testParam0      = new List <byte>();

            testObject.WriteTo(testParam0);

            List <byte> expected = Encoding.ASCII.GetBytes(testObjectValue.ToString("d", CultureInfo.InvariantCulture) + " ").ToList();

            AssertionHelpers.AssertSameElements(expected, testParam0);
        }
Exemplo n.º 4
0
        public void PdfIntegerClass_WriteToMethodWithStreamParameter_WritesCorrectValueToList()
        {
            int        testObjectValue = _rnd.Next(int.MinValue, int.MaxValue);
            PdfInteger testObject      = new PdfInteger(testObjectValue);

            using (MemoryStream testParam0 = new MemoryStream())
            {
                testObject.WriteTo(testParam0);

                using (MemoryStream expected = new MemoryStream(Encoding.ASCII.GetBytes(testObjectValue.ToString("d", CultureInfo.InvariantCulture) + " ")))
                {
                    AssertionHelpers.AssertSameElements(expected, testParam0);
                }
            }
        }