Exemple #1
0
 public void InfoHasExpectedFrameCount([NotNull] string fileName, [NotNull] TestAudioInfo expectedAudioInfo)
 {
     Assert.Equal(expectedAudioInfo.SampleCount, new AudioFile(
                      Path.Combine(
                          new DirectoryInfo(Directory.GetCurrentDirectory()).Parent?.Parent?.Parent?.Parent?.FullName,
                          "TestFiles",
                          "Valid",
                          fileName))
                  .Info.FrameCount);
 }
Exemple #2
0
 public void InfoHasExpectedPlayLength([NotNull] string fileName, [NotNull] TestAudioInfo expectedAudioInfo)
 {
     Assert.Equal(
         expectedAudioInfo.SampleCount == 0
             ? TimeSpan.Zero
             : new TimeSpan(0, 0,
                            (int)Math.Round(expectedAudioInfo.SampleCount / (double)expectedAudioInfo.SampleRate)),
         new AudioFile(Path.Combine(
                           new DirectoryInfo(Directory.GetCurrentDirectory()).Parent?.Parent?.Parent?.Parent?.FullName,
                           "TestFiles",
                           "Valid",
                           fileName))
         .Info.PlayLength);
 }