Exemple #1
0
        public void Saving_Item_Has_Id_Of_1()
        {
            var item = new StubInt64Entity {
                Name = "Testing"
            };

            _db.GetCollection <StubInt64Entity>("testEntities").InsertOne(item);

            Assert.AreEqual(1, item.Id);
        }
Exemple #2
0
        public void When_Saving_2_Items_Second_Item_Has_Id_Of_2()
        {
            var item1 = new StubInt64Entity {
                Name = "Testing"
            };
            var item2 = new StubInt64Entity {
                Name = "Testing 2"
            };

            _db.GetCollection <StubInt64Entity>("testEntities").InsertOne(item1);
            _db.GetCollection <StubInt64Entity>("testEntities").InsertOne(item2);

            Assert.AreEqual(2, item2.Id);
        }