public void ReadNumChannelsTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <byte> channels = Flac.ReadNumChannels(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(channels.IsSucc); ((byte)channels).Should().Be((byte)model.Record.Channels); } }
public void ReadBitDepthTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <byte> bitDepth = Flac.ReadBitDepth(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(bitDepth.IsSucc); ((byte)bitDepth).Should().Be(model.Record.BitDepth); } }
public void ReadSampleRateTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <uint> sampleRate = Flac.ReadSampleRate(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(sampleRate.IsSucc); ((uint)sampleRate).Should().Be(model.Record.SampleRateHertz); } }
public void ReadTotalSamplesTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FlacHeaderExtractor)) { Fin <ulong> totalSamples = Flac.ReadTotalSamples(model.ToTargetInformation(this.RealFileSystem).FileStream); Assert.True(totalSamples.IsSucc); ((ulong)totalSamples).Should().Be(model.Record.TotalSamples); } }
public void HasLogFileTest(FixtureModel model) { if (model.Process.ContainsKey(FixtureModel.FrontierLabsLogFileExtractor)) { TargetInformation ti = model.ToTargetInformation(this.RealFileSystem); Assert.True(ti.TargetSupportFiles.ContainsKey(LogFile.LogFileKey)); } }
private (byte[] FormatChunk, RangeHelper.Range DataChunk) ReadChunkRanges(FixtureModel model) { using var stream = model.ToTargetInformation(this.RealFileSystem).FileStream; var riffChunk = Wave.FindRiffChunk(stream); var waveChunk = riffChunk.Bind(r => Wave.FindWaveChunk(stream, r)); var formatChunk = waveChunk.Bind(w => Wave.FindFormatChunk(stream, w)); var dataChunk = waveChunk.Bind(w => Wave.FindDataChunk(stream, w)); var formatSpan = RangeHelper.ReadRange(stream, (RangeHelper.Range)formatChunk); return(formatSpan.ToArray(), (RangeHelper.Range)dataChunk); }
public void HasMetadataBlockTest(FixtureModel model) { bool hasMetadata = Flac.HasMetadataBlock(model.ToTargetInformation(this.RealFileSystem).FileStream).IfFail(false); ((bool)hasMetadata).Should().Be(model.IsFlac && model.ValidMetadata != ValidMetadata.No); }
public void IsFlacFileTest(FixtureModel model) { bool isFlac = Flac.IsFlacFile(model.ToTargetInformation(this.RealFileSystem).FileStream).IfFail(false); isFlac.Should().Be(model.IsFlac); }
public void HasFrontierLabsVorbisComment(FixtureModel model) { bool hasComment = FrontierLabs.HasFrontierLabsVorbisComment(model.ToTargetInformation(this.RealFileSystem).FileStream).IfFail(false); hasComment.Should().Be(model.Process.ContainsKey(FixtureModel.FlacCommentExtractor)); }