public async void UpdateSelectiveAsync_ChangesFieldSubsetOnly()
        {
            //Arrange
            var contextOptions = InMemoryUtils.ProduceFreshDbContextOptions();
            var oldModel       = ResourceUtils.TestSet.First();

            using (var context = new ApplicationDbContext(contextOptions))
            {
                context.Resources.Add(oldModel);
                context.SaveChanges();
            }
            var newModel = ResourceUtils.TestSet.Last();

            //Act
            using (var context = new ApplicationDbContext(contextOptions))
            {
                ITrackEntityRepository <Resource, int, ApplicationUser, string> repo = new ResourcesRepository(context);
                newModel.Id = oldModel.Id;
                await repo.UpdateSelectiveAsync <ResourceTestUpdateSubset>(newModel);
            }

            //Assert
            using (var context = new ApplicationDbContext(contextOptions))
            {
                Assert.NotEqual(oldModel.Title, context.Resources.First().Title);
                Assert.Equal(newModel.Title, context.Resources.First().Title);
                Assert.NotEqual(newModel.Description, context.Resources.First().Description);
            }
        }
        public async void UpdateSelectiveAsync_ThrowsNotFound_OnNonExistent()
        {
            //Arrange
            var contextOptions = InMemoryUtils.ProduceFreshDbContextOptions();
            var oldModel       = ResourceUtils.TestSet.First();

            using (var context = new ApplicationDbContext(contextOptions))
            {
                context.Resources.Add(oldModel);
                context.SaveChanges();
            }
            var newModel = ResourceUtils.TestSet.Last();

            using (var context = new ApplicationDbContext(contextOptions))
            {
                ITrackEntityRepository <Resource, int, ApplicationUser, string> repo = new ResourcesRepository(context);
                newModel.Id = ResourceUtils.NonExistentId;

                //Assert-Act
                await Assert.ThrowsAsync <CurrentEntryNotFoundException>(() => repo.UpdateSelectiveAsync <ResourceTestUpdateSubset>(newModel));

                Assert.Equal(oldModel.Title, context.Resources.First().Title);
            }
        }