private void ErrorOnUpdate <TEntity, TEntityList>()
            where TEntity : EntityBase, INamedEntity, new()
            where TEntityList : EntityListBase <TEntity, NamedBindingItem <TEntity> >, new()
        {
            const string name1 = "Performance";
            const string name2 = "Rehearsal";
            var          list  = new TEntityList {
                Session = Session
            };

            list.Populate(); // Creates an empty BindingList
            var bindingList = list.BindingList;
            var item1       = bindingList.AddNew();

            list.OnRowEnter(0);
            item1.Name = name1;
            list.OnRowValidated(0);
            var item2 = bindingList.AddNew();

            list.OnRowEnter(1);
            item2.Name = name2;
            list.OnRowValidated(1);
            var exception = Assert.Catch <DuplicateNameException>(
                () => item2.Name = name1,
                "Rename name should have thrown DuplicateNameException.");

            Assert.AreEqual("Another EventType with key 'Performance' already exists.",
                            exception.Message, "Message");
            list.OnValidationError(1, "Name", exception);
            Assert.AreEqual(StatementType.Update,
                            list.LastDatabaseUpdateErrorException !.ChangeAction, "ChangeAction");
            Assert.AreEqual(1, list.LastDatabaseUpdateErrorException !.RowIndex, "RowIndex");
            Assert.AreEqual(0, list.LastDatabaseUpdateErrorException !.ColumnIndex,
                            "ColumnIndex");
            Assert.AreSame(exception, list.LastDatabaseUpdateErrorException !.InnerException,
                           "InnerException");
        }