1515
1616using Xunit ;
1717
18- namespace SixLabors . ImageSharp . Tests
18+ namespace SixLabors . ImageSharp . Tests . Formats
1919{
2020 public class GeneralFormatTests : FileTestBase
2121 {
@@ -41,7 +41,7 @@ public void ImageCanEncodeToString()
4141 {
4242 using ( Image < Rgba32 > image = file . CreateRgba32Image ( ) )
4343 {
44- string filename = path + "/" + file . FileNameWithoutExtension + " .txt";
44+ string filename = Path . Combine ( path , $ " { file . FileNameWithoutExtension } .txt") ;
4545 File . WriteAllText ( filename , image . ToBase64String ( PngFormat . Instance ) ) ;
4646 }
4747 }
@@ -56,7 +56,7 @@ public void DecodeThenEncodeImageFromStreamShouldSucceed()
5656 {
5757 using ( Image < Rgba32 > image = file . CreateRgba32Image ( ) )
5858 {
59- image . Save ( $ " { path } / { file . FileName } " ) ;
59+ image . Save ( Path . Combine ( path , file . FileName ) ) ;
6060 }
6161 }
6262 }
@@ -103,25 +103,30 @@ public void ImageCanConvertFormat()
103103 {
104104 using ( Image < Rgba32 > image = file . CreateRgba32Image ( ) )
105105 {
106- using ( FileStream output = File . OpenWrite ( $ "{ path } / { file . FileNameWithoutExtension } .bmp") )
106+ using ( FileStream output = File . OpenWrite ( Path . Combine ( path , $ "{ file . FileNameWithoutExtension } .bmp") ) )
107107 {
108108 image . SaveAsBmp ( output ) ;
109109 }
110110
111- using ( FileStream output = File . OpenWrite ( $ "{ path } / { file . FileNameWithoutExtension } .jpg") )
111+ using ( FileStream output = File . OpenWrite ( Path . Combine ( path , $ "{ file . FileNameWithoutExtension } .jpg") ) )
112112 {
113113 image . SaveAsJpeg ( output ) ;
114114 }
115115
116- using ( FileStream output = File . OpenWrite ( $ "{ path } / { file . FileNameWithoutExtension } .png") )
116+ using ( FileStream output = File . OpenWrite ( Path . Combine ( path , $ "{ file . FileNameWithoutExtension } .png") ) )
117117 {
118118 image . SaveAsPng ( output ) ;
119119 }
120120
121- using ( FileStream output = File . OpenWrite ( $ "{ path } / { file . FileNameWithoutExtension } .gif") )
121+ using ( FileStream output = File . OpenWrite ( Path . Combine ( path , $ "{ file . FileNameWithoutExtension } .gif") ) )
122122 {
123123 image . SaveAsGif ( output ) ;
124124 }
125+
126+ using ( FileStream output = File . OpenWrite ( Path . Combine ( path , $ "{ file . FileNameWithoutExtension } .tga") ) )
127+ {
128+ image . SaveAsTga ( output ) ;
129+ }
125130 }
126131 }
127132 }
0 commit comments