File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/TaglibSharp.Tests/FileFormats Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -109,5 +109,29 @@ public void TestRemoveTags ()
109
109
file . RemoveTags ( TagTypes . AllTags ) ;
110
110
Assert . AreEqual ( TagTypes . None , file . TagTypes ) ;
111
111
}
112
+
113
+ [ Test ]
114
+ public void TestCreateId3Tags ( )
115
+ {
116
+ string tempFile = TestPath . Samples + "tmpwrite_sample_createid3tags.mp3" ;
117
+
118
+ System . IO . File . Copy ( sample_file , tempFile , true ) ;
119
+
120
+ // Remove All Tags first
121
+ var file = File . Create ( tempFile ) ;
122
+ file . RemoveTags ( TagTypes . AllTags ) ;
123
+ file . Save ( ) ;
124
+
125
+ // No TagTypes should exist
126
+ TagLib . Mpeg . AudioFile . CreateID3Tags = false ;
127
+ file = File . Create ( tempFile ) ;
128
+ Assert . AreEqual ( TagTypes . None , file . TagTypes ) ;
129
+ file . Save ( ) ;
130
+
131
+ // Empty TagTypes should be created
132
+ TagLib . Mpeg . AudioFile . CreateID3Tags = true ;
133
+ file = File . Create ( tempFile ) ;
134
+ Assert . AreEqual ( TagTypes . Id3v1 | TagTypes . Id3v2 , file . TagTypes ) ;
135
+ }
112
136
}
113
137
}
You can’t perform that action at this time.
0 commit comments