Exemplo 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.");
     }
 }
Exemplo 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.");
 }
Exemplo 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.");
 }