public async Task Can_browse()
        {
            IMongoDatabase database  = MongoForTest.Provider.GetDatabase();
            var            repo      = new DataAssetMongoRepository(database);
            DataAsset      dataAsset = BuildDummyDataAsset();
            await repo.AddAsync(dataAsset);

            await repo.BrowseAsync(new GetDataAssets());
        }
        public async Task Can_check_if_exists()
        {
            IMongoDatabase database  = MongoForTest.Provider.GetDatabase();
            var            repo      = new DataAssetMongoRepository(database);
            DataAsset      dataAsset = BuildDummyDataAsset();
            await repo.AddAsync(dataAsset);

            (await repo.ExistsAsync(dataAsset.Id)).Should().BeTrue();
        }
        public async Task Can_get_by_id()
        {
            IMongoDatabase database  = MongoForTest.Provider.GetDatabase();
            var            repo      = new DataAssetMongoRepository(database);
            DataAsset      dataAsset = BuildDummyDataAsset();
            await repo.AddAsync(dataAsset);

            DataAsset result = await repo.GetAsync(dataAsset.Id);

            result.Should().BeEquivalentTo(dataAsset);
        }
        public async Task Can_browse_null_query()
        {
            IMongoDatabase database  = MongoForTest.Provider.GetDatabase();
            var            repo      = new DataAssetMongoRepository(database);
            DataAsset      dataAsset = BuildDummyDataAsset();
            await repo.AddAsync(dataAsset);

            var result = await repo.BrowseAsync(null);

            result.Items.Should().HaveCount(0);
        }
        public async Task Can_remove_async()
        {
            IMongoDatabase database  = MongoForTest.Provider.GetDatabase();
            var            repo      = new DataAssetMongoRepository(database);
            DataAsset      dataAsset = BuildDummyDataAsset();
            await repo.AddAsync(dataAsset);

            await repo.RemoveAsync(dataAsset.Id);

            (await repo.ExistsAsync(dataAsset.Id)).Should().BeFalse();
            DataAsset result = await repo.GetAsync(dataAsset.Id);

            result.Should().BeNull();
        }
        public async Task Can_browse_with_query_and_pagination()
        {
            IMongoDatabase database  = MongoForTest.Provider.GetDatabase();
            var            repo      = new DataAssetMongoRepository(database);
            DataAsset      dataAsset = BuildDummyDataAsset();
            await repo.AddAsync(dataAsset);

            GetDataAssets query = new GetDataAssets();

            query.OnlyPublishable = true;
            query.Page            = 0;
            query.Results         = 10;
            await repo.BrowseAsync(query);
        }