Esempio n. 1
0
        public void GetById_WithValidId_Succeed()
        {
            var fakeEntity = CreateFakeEntity();
            var documentSessionProvider = new DocumentSessionProvider(Store);
            var fakeRepository          = new FakeRepository(documentSessionProvider);

            var fakeEntity2 = fakeRepository.GetById(fakeEntity.Id);

            Assert.IsNotNull(fakeEntity2);
        }
Esempio n. 2
0
        public void MakeTransient_WithValidEntity_Succeed()
        {
            var fakeEntity = CreateFakeEntity();


            var documentSessionProvider = new DocumentSessionProvider(Store);
            var fakeRepository          = new FakeRepository(documentSessionProvider);
            var deletingEntity          = fakeRepository.GetById(fakeEntity.Id);

            fakeRepository.MakeTransient(deletingEntity);
            fakeRepository.SaveChanges();

            using (var session = Store.OpenSession())
            {
                var entities = session.Query <FakeEntity> ();

                Assert.AreEqual(0, entities.Count());
            }
        }