public void NotAcceptAnEntityWithTheSameIdentityTwice()
        {
            var ent1 = EntityFixture.CreateEntityWithId(1);
            var ent2 = EntityFixture.CreateEntityWithId(2);

            Tests.NotAcceptAnEntityWithTheSameIdentityTwice(_repos, ent1, ent2);
        }
        public void NotAcceptADifferentEntityWithTheSameId()
        {
            var ent1 = EntityFixture.CreateEntityWithId(1);
            var ent2 = EntityFixture.CreateEntityWithId(1);

            Tests.NotAcceptADifferentEntityWithTheSameId(_repos, ent1, ent2);
        }
Beispiel #3
0
        public void ThatEntityCanBeIdentifiedByAnId()
        {
            var repos = RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("test");
            var ent   = EntityFixture.CreateIntIdEntity();

            repos.Add(ent);

            Assert.AreEqual(ent, repos.First(e => e.Id.Equals(ent.Id)));
        }
        public void HaveTwoItemsWhenTwoEntitiesAreAdded()
        {
            var ent1 = EntityFixture.CreateEntityWithId(1);
            var ent2 = EntityFixture.CreateEntityWithId(2);

            ent1.Name = "Entity1";
            ent2.Name = "Entity2";

            Tests.HaveTwoItemsWhenTwoEntitiesAreAdded(_repos, ent1, ent2);
        }
Beispiel #5
0
        public void ThatEntityCanBeIdentitiedByItsIdentiy()
        {
            var ent = EntityFixture.CreateEntityWithId(1);

            ent.Name = "TestEntity";
            var repos = RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("test");

            repos.Add(ent);

            Assert.AreEqual(ent, repos.SingleOrDefault(e => e.IsIdentical(ent)));
        }
        public void ReturnAnEntityById()
        {
            var ent1 = EntityFixture.CreateEntityWithId(1);

            ent1.Name = "Entity1";
            var ent2 = EntityFixture.CreateEntityWithId(2);

            ent2.Name = "Entity2";

            Tests.ReturnAnEntityById(_repos, ent1, ent2);
        }
        public void ReturnTheEntityThatWasAdded()
        {
            var ent = EntityFixture.CreateIntIdEntity();

            Tests.ReturnTheEntityThatWasAdded(_repos, ent);
        }
        public void HaveOneItemWhenAnEntityIsAdded()
        {
            var ent = EntityFixture.CreateEntityWithId(1);

            Tests.HaveOneItemWhenAnEntityIsAdded(_repos, ent);
        }
        public void ThrowAnErrorWhenTryingToRemoveNonAddedEntity()
        {
            var ent = EntityFixture.CreateIntIdEntity();

            Tests.ThrowAnErrorWhenTryingToRemoveNonAddedEntity(_repos, ent);
        }
        public void RemoveTestEntityById()
        {
            var ent1 = EntityFixture.CreateEntityWithId(1);

            Tests.RemoveTestEntityById(_repos, ent1);
        }
        public void NotAcceptTheSameEntityTwice()
        {
            var ent = EntityFixture.CreateEntityWithId(1);

            Tests.NotAcceptTheSameEntityTwice(_repos, ent);
        }