-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAudiofileTests.cs
More file actions
48 lines (44 loc) · 2.04 KB
/
AudiofileTests.cs
File metadata and controls
48 lines (44 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//This file is part of AudioCuesheetEditor.
//AudioCuesheetEditor is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//AudioCuesheetEditor is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//You should have received a copy of the GNU General Public License
//along with Foobar. If not, see
//<http: //www.gnu.org/licenses />.
using AudioCuesheetEditor.Model.IO.Audio;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
namespace AudioCuesheetEditor.Tests.Model.IO.Audio
{
[TestClass()]
public class AudiofileTests
{
[TestMethod()]
public void AudioFileTest()
{
var audioFile = new Audiofile("test.mp3");
Assert.IsNull(audioFile.ContentStream);
Assert.IsFalse(audioFile.IsContentStreamLoaded);
Assert.IsNotNull(audioFile.Name);
Assert.AreEqual("MP3", audioFile.AudioFileType);
audioFile = new Audiofile("Test");
Assert.AreEqual(audioFile.AudioFileType, string.Empty);
Assert.IsNotNull(audioFile.Name);
var codec = Audiofile.AudioCodecs.Single(x => x.FileExtension == ".ogg");
audioFile = new Audiofile("test", "TestobjectURL", codec);
Assert.IsNotNull(audioFile.Name);
Assert.AreEqual("test.ogg", audioFile.Name);
Assert.AreEqual("OGG", audioFile.AudioFileType);
Assert.IsNotNull(audioFile.ObjectURL);
Assert.IsTrue(audioFile.PlaybackPossible);
codec = Audiofile.AudioCodecs.Single(x => x.FileExtension == ".mp3");
var audioFile2 = new Audiofile(audioFile.Name, "TestObjectURL2", codec);
Assert.AreEqual("test.mp3", audioFile2.Name);
}
}
}