public override void Arrange()
        {
            base.Arrange();

            var data = new List <KeyedNonId>
            {
                new KeyedNonId {
                    Id = 1, Name = "1"
                },
                new KeyedNonId {
                    Id = 2, Name = "2"
                },
            }.AsQueryable();

            MockKeyedNonIdSet = new Mock <DbSet <KeyedNonId> >();
            MockKeyedNonIdSet.As <IQueryable <KeyedNonId> >().Setup(m => m.Provider).Returns(data.Provider);
            MockKeyedNonIdSet.As <IQueryable <KeyedNonId> >().Setup(m => m.Expression).Returns(data.Expression);
            MockKeyedNonIdSet.As <IQueryable <KeyedNonId> >().Setup(m => m.ElementType).Returns(data.ElementType);
            MockKeyedNonIdSet.As <IQueryable <KeyedNonId> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            MockKeyedNonIdSet.Setup(s => s.Find(It.IsAny <object[]>())).Returns(() =>
            {
                _old = new KeyedNonId
                {
                    Id           = 1,
                    Name         = "updated",
                    TestEntities = new List <TestEntity>
                    {
                        new TestEntity {
                            Id = 2
                        },
                        new TestEntity {
                            Id = 3
                        },
                        new TestEntity {
                            Id = 1
                        }
                    }
                };

                return(_old);
            });

            MockContext = new Mock <ModelContext>();

            MockContext.Setup(c => c.Set <KeyedNonId>()).Returns(MockKeyedNonIdSet.Object);

            _repository = new Repository <KeyedNonId>(MockContext.Object);

            RelationshipLoaderAdapter.LoadFunction = (DbContext context, object entity, string[] includes) => { return; };
        }
        public override void Act()
        {
            base.Act();

            _updated = _repository.Update(new KeyedNonId
            {
                Name         = "updated",
                TestEntities = new List <TestEntity>
                {
                    new TestEntity {
                        Id = 1
                    },
                    new TestEntity {
                        Id = 4
                    }
                }
            }, "TestEntities");
        }