|
|
|
@ -162,13 +162,31 @@ namespace TestSuite.ApiTests |
|
|
|
var asset_1 = await _.UploadFileAsync("Assets/logo-squared.png", "image/png"); |
|
|
|
|
|
|
|
|
|
|
|
// STEP 2: Query asset
|
|
|
|
var assets = await _.Assets.GetAssetsAsync(_.AppName, new AssetQuery |
|
|
|
// STEP 2: Query asset by pixel width.
|
|
|
|
var assets_1 = await _.Assets.GetAssetsAsync(_.AppName, new AssetQuery |
|
|
|
{ |
|
|
|
Filter = "metadata/pixelWidth eq 600" |
|
|
|
}); |
|
|
|
|
|
|
|
Assert.Contains(assets.Items, x => x.Id == asset_1.Id); |
|
|
|
Assert.Contains(assets_1.Items, x => x.Id == asset_1.Id); |
|
|
|
|
|
|
|
|
|
|
|
// STEP 3: Add custom metadata.
|
|
|
|
asset_1.Metadata["custom"] = "foo"; |
|
|
|
|
|
|
|
await _.Assets.PutAssetAsync(_.AppName, asset_1.Id.ToString(), new AnnotateAssetDto |
|
|
|
{ |
|
|
|
Metadata = asset_1.Metadata |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// STEP 4: Query asset by custom metadata
|
|
|
|
var assets_2 = await _.Assets.GetAssetsAsync(_.AppName, new AssetQuery |
|
|
|
{ |
|
|
|
Filter = "metadata/custom eq 'foo'" |
|
|
|
}); |
|
|
|
|
|
|
|
Assert.Contains(assets_2.Items, x => x.Id == asset_1.Id); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|