Example #1
0
        public void Can_save_and_load_strongly_typed_document_with_nullable_object_id()
        {
            var origin = new NonIdObjectIdSample();
            var id     = _collection.Save(origin, false);

            var reloaded = _collection.Load <NonIdObjectIdSample>(id);

            Assert.That(reloaded.OtherNullableId.HasValue, Is.False);
        }
Example #2
0
        public void Can_save_and_load_strongly_typed_document_with_reference_to_other_object_id()
        {
            var other = new NonIdObjectIdSample();

            var otherId = _collection.Save(other, false);

            var origin = new NonIdObjectIdSample {
                OtherId = otherId, OtherNullableId = otherId
            };
            var id = _collection.Save(origin, false);

            var reloaded = _collection.Load <NonIdObjectIdSample>(id);

            Assert.That(reloaded.OtherId, Is.EqualTo(otherId));
            Assert.That(reloaded.OtherNullableId.HasValue, Is.True);
            Assert.That(reloaded.OtherNullableId.Value, Is.EqualTo(otherId));
        }