public void UpdateExistingEntryIdMatch()
        {
            var entryContainer = new EntityEntryContainer();
            var entity         = new EntityEntryContainerModel
            {
                Id    = "123",
                Title = "EntityEntryContainerTests.UpdateExistingEntryWithId-1"
            };

            entryContainer.SetEntityState(entity, EntityEntryState.Added);

            var entry = entryContainer.GetEntry(entity);

            Assert.AreEqual(entity, entry.Entity);
            Assert.AreEqual(EntityEntryState.Added, entry.State);

            var updatedEntity = new EntityEntryContainerModel
            {
                Id    = "123",
                Title = "EntityEntryContainerTests.UpdateExistingEntryWithId-2"
            };

            entryContainer.SetEntityState(updatedEntity, EntityEntryState.Updated);

            Assert.IsFalse(entryContainer.Entries().Any(e => e.Entity == entity));

            entry = entryContainer.GetEntry(updatedEntity);
            Assert.AreEqual(updatedEntity, entry.Entity);
            Assert.AreEqual("EntityEntryContainerTests.UpdateExistingEntryWithId-2", (entry.Entity as EntityEntryContainerModel).Title);
        }
        public void UpdateExistingEntryInstanceMatch()
        {
            var entryContainer = new EntityEntryContainer();
            var entity         = new EntityEntryContainerModel
            {
                Title = "EntityEntryContainerTests.UpdateExistingEntryWithoutId"
            };

            entryContainer.SetEntityState(entity, EntityEntryState.Added);

            var entry = entryContainer.GetEntry(entity);

            Assert.AreEqual(entity, entry.Entity);
            Assert.AreEqual(EntityEntryState.Added, entry.State);

            entryContainer.SetEntityState(entity, EntityEntryState.NoChanges);

            entry = entryContainer.GetEntry(entity);
            Assert.AreEqual(entity, entry.Entity);
            Assert.AreEqual(EntityEntryState.NoChanges, entry.State);
        }
        public void AddNewEntry()
        {
            var entryContainer = new EntityEntryContainer();
            var entity         = new EntityEntryContainerModel
            {
                Title = "EntityEntryContainerTests.AddNewEntry"
            };

            entryContainer.SetEntityState(entity, EntityEntryState.Added);

            var entry = entryContainer.GetEntry(entity);

            Assert.AreEqual(entity, entry.Entity);
            Assert.AreEqual(EntityEntryState.Added, entry.State);
        }