Esempio n. 1
0
 public void ReadWavFile_FilePathDoesNotExist()
 {
     using (var tempDirPath = new TemporaryFolder(Path.GetRandomFileName()))
     {
         string filePath = tempDirPath.Combine(tempDirPath.Path, "TestData/123.wav");
         Assert.Throws <DirectoryNotFoundException>(() => WavConverter.ReadWavFile(filePath), "DirectoryNotFoundException was not thrown.");
     }
 }
Esempio n. 2
0
 public void ReadWavFile_WrongExtension()
 {
     Assert.That(() => WavConverter.ReadWavFile(Path.GetTempFileName()),
                 Throws.TypeOf <Exception>().With.Message.EqualTo("SaveFile is not a .wav file."), "ReadWavFile didn't break when the SaveFile was not a .wav file.");
 }
Esempio n. 3
0
 public void ReadWavFile_ConvertSingleFile()
 {
     byte[] result = WavConverter.ReadWavFile(_goodWavFile);
     Assert.IsNotEmpty(result, "ReadWavFile did not read the bytes of a file into a byte array.");
 }