public void UnsafeObjectStream_ReserveInsert_ReservesSpaceForMultipleObjects()
        {
            var stream = new UnsafeObjectStream();

            stream.AcquirePointers();
            try
            {
                unsafe
                {
                    stream.ReserveMultiple(2, 2 * sizeof(UnsafeObjectTypeOne));

                    *(UnsafeObjectTypeOne*)stream.Data = new UnsafeObjectTypeOne() { ObjectType = UnsafeObjectType.TypeOne, Value1 = 123 };
                    stream.FinalizeObject(sizeof(UnsafeObjectTypeOne));

                    *(UnsafeObjectTypeOne*)stream.Data = new UnsafeObjectTypeOne() { ObjectType = UnsafeObjectType.TypeOne, Value1 = 234 };
                    stream.FinalizeObject(sizeof(UnsafeObjectTypeOne));

                    stream.ReserveInsert(1, 2, 2 * sizeof(UnsafeObjectTypeTwo));

                    *(UnsafeObjectTypeTwo*)stream.Data = new UnsafeObjectTypeTwo() { ObjectType = UnsafeObjectType.TypeTwo, Value1 = 111, Value2 = 222 };
                    stream.FinalizeObject(sizeof(UnsafeObjectTypeTwo));

                    *(UnsafeObjectTypeTwo*)stream.Data = new UnsafeObjectTypeTwo() { ObjectType = UnsafeObjectType.TypeTwo, Value1 = 333, Value2 = 444 };
                    stream.FinalizeObject(sizeof(UnsafeObjectTypeTwo));

                    TheResultingValue(stream.LengthInBytes).ShouldBe(2 * sizeof(UnsafeObjectTypeOne) + 2 * sizeof(UnsafeObjectTypeTwo));
                    TheResultingValue(stream.LengthInObjects).ShouldBe(4);

                    var objData0 = (UnsafeObjectTypeOne*)stream.SeekObject(0);
                    TheResultingValue(objData0->ObjectType).ShouldBe(UnsafeObjectType.TypeOne);
                    TheResultingValue(objData0->Value1).ShouldBe(123);

                    var objData1 = (UnsafeObjectTypeTwo*)stream.SeekObject(1);
                    TheResultingValue(objData1->ObjectType).ShouldBe(UnsafeObjectType.TypeTwo);
                    TheResultingValue(objData1->Value1).ShouldBe(111);
                    TheResultingValue(objData1->Value2).ShouldBe(222);

                    var objData2 = (UnsafeObjectTypeTwo*)stream.SeekObject(2);
                    TheResultingValue(objData2->ObjectType).ShouldBe(UnsafeObjectType.TypeTwo);
                    TheResultingValue(objData2->Value1).ShouldBe(333);
                    TheResultingValue(objData2->Value2).ShouldBe(444);

                    var objData3 = (UnsafeObjectTypeOne*)stream.SeekObject(3);
                    TheResultingValue(objData3->ObjectType).ShouldBe(UnsafeObjectType.TypeOne);
                    TheResultingValue(objData3->Value1).ShouldBe(234);
                }
            }
            finally
            {
                stream.ReleasePointers();
            }
        }