public async Task Updated_Collection_Should_Not_Be_Tracked()
        {
            //Given
            const string newName    = "New Collection Name";
            var          collection = new Collection {
                Name = "A Collection"
            };
            await Database.OnceAndSaveAsync(async db => await db.Collections.AddAsync(collection));

            //When
            await Database.OnceAsync(async db =>
            {
                var repository = new CollectionRepository(db);

                collection.Name = newName;
                await repository.UpdateAsync(collection);

                collection.Name = "Manipulated Name";
                await db.SaveChangesAsync();
            });

            //Then
            var updated = await Database.OnceAsync(async db =>
                                                   await db.Collections.FindAsync(collection.Id));

            Assert.Equal(newName, updated.Name);
        }
        public async Task Can_Update_A_Collection()
        {
            //Given
            const string newName    = "New Collection Name";
            var          collection = new Collection {
                Name = "A Collection"
            };
            await Database.OnceAndSaveAsync(async db => await db.Collections.AddAsync(collection));

            //When
            var isSucceed = await Database.OnceAsync(async db =>
            {
                var repository = new CollectionRepository(db);

                collection.Name = newName;
                return(await repository.UpdateAsync(collection));
            });

            //Then
            Assert.True(isSucceed);
            var updated = await Database.OnceAsync(async db =>
                                                   await db.Collections.FindAsync(collection.Id));

            Assert.Equal(newName, updated.Name);
        }