33
44using System . ComponentModel ;
55using SixLabors . ImageSharp . Textures . Formats . Ktx2 ;
6+ using SixLabors . ImageSharp . Textures . Tests . Enums ;
7+ using SixLabors . ImageSharp . Textures . Tests . TestUtilities . Attributes ;
8+ using SixLabors . ImageSharp . Textures . Tests . TestUtilities . TextureProviders ;
69using SixLabors . ImageSharp . Textures . TextureFormats ;
710
811namespace SixLabors . ImageSharp . Textures . Tests . Formats . Ktx2 ;
@@ -12,18 +15,13 @@ public class Ktx2DecoderTests
1215{
1316 private static readonly Ktx2Decoder Ktx2Decoder = new ( ) ;
1417
15- [ Fact ]
18+ [ Theory ]
1619 [ Description ( "Ensure that a single mipmap level does not result in an empty mipmap collection" ) ]
17- public void Ktx2Decoder_LevelCountZero_DecodesBaseLevelMipMap ( )
20+ [ WithFile ( TestTextureFormat . Ktx2 , TestTextureType . Flat , TestTextureTool . ToKtx , TestImages . Ktx2 . Rgba32SrgbMips ) ]
21+ public void Ktx2Decoder_LevelCountZero_DecodesBaseLevelMipMap ( TestTextureProvider provider )
1822 {
19- string path = Path . Combine (
20- TestEnvironment . InputImagesDirectoryFullPath ,
21- "Ktx2" ,
22- "Flat" ,
23- "rgba32-srgb-mips.ktx2" ) ;
24-
25- using FileStream fileStream = File . OpenRead ( path ) ;
26- using Texture texture = Ktx2Decoder . DecodeTexture ( Configuration . Default , fileStream ) ;
23+ using Texture texture = provider . GetTexture ( Ktx2Decoder ) ;
24+ provider . SaveTextures ( texture ) ;
2725
2826 FlatTexture flatTexture = texture as FlatTexture ;
2927 Assert . NotNull ( flatTexture ) ;
0 commit comments