public void ShouldDeleteEntity()
        {
            using (var repository = Kernel.Get <IMongoEntityRepository>())
            {
                repository.Initialize(ConnectionStringName, DatabaseName);

                var entity = new MongoEntity()
                {
                    Name = "Test Entity"
                };

                var id = repository.Save(entity);

                Assert.AreNotEqual(ObjectId.Empty, id);

                var result = repository.GetOne(e => e.Id.Equals(id));

                Assert.IsNotNull(result);
                Assert.AreEqual(id, result.Id);

                repository.Delete(result);

                repository.GetOne(e => e.Id.Equals(id));
                Assert.Fail("Should not reach this line");
            }
        }
        public void ShouldUpdateEntity()
        {
            using (var repository = Kernel.Get <IMongoEntityRepository>())
            {
                const string originalName    = "originalName";
                const string updatedName     = "updatedName";
                const string updatedProperty = "updatedProperty";

                repository.Initialize(ConnectionStringName, DatabaseName);

                var entity = new MongoEntity()
                {
                    Name = originalName, Property = string.Empty
                };

                var id = repository.Save(entity);

                Assert.AreNotEqual(ObjectId.Empty, id);

                var result = repository.GetOne(e => e.Id.Equals(id));

                Assert.IsNotNull(result);
                Assert.AreEqual(id, result.Id);
                Assert.AreEqual(originalName, result.Name);

                result.Name     = updatedName;
                result.Property = updatedProperty;

                repository.Update(result);

                var updatedResult = repository.GetOne(e => e.Id.Equals(id));

                Assert.IsNotNull(updatedResult);
                Assert.AreEqual(updatedName, updatedResult.Name);
                Assert.AreEqual(updatedProperty, updatedResult.Property);
            }
        }