public void TwoInstanceMustBeTheSame()
        {
            var instance1 = new IndirectReferenceObject(1);
            var instance2 = new IndirectReferenceObject(1);

            instance1.Should().Equals(instance2);
        }
Ejemplo n.º 2
0
        public ArrayObject Add(BaseObject obj)
        {
            if (obj is IndirectObject)
                obj = new IndirectReferenceObject(((IndirectObject)obj).Reference);

            _objects.Add(obj);
            return this;
        }
        public void MustBeNumbers(string fragment)
        {
            // 7.3.7 Dictionary Objects
            byte[]    bytes = System.Text.UTF8Encoding.UTF8.GetBytes(fragment);
            Tokenizer feed  = new Tokenizer(new MemoryStream(bytes));

            Assert.Throws <PdfException>(() => { var a = new IndirectReferenceObject(feed); });
        }
 public void ACreatedNumberMustBePositive()
 {
     Assert.Throws <PdfException>(() => { var a = new IndirectReferenceObject(-1); });
 }
Ejemplo n.º 5
0
        private bool WriteObject(IndirectReferenceObject reference)
        {
            if (reference == null)
                return false;

            Write(reference.Value.Id.ToString())
                .Write(" ")
                .Write(reference.Value.Generation.ToString())
                .Write(" R");

            return true;
        }