示例#1
0
        public void TestAlignedLogSweep()
        {
            var sweep = Dsp.AlignedLogSweep(20, 2000, .1, Dsp.SweepAlignments.NegativeOne, 44100).ToReadOnlyList();

            Assert.That(sweep.Count == 4410);
            Assert.That(sweep[0] == 0);
            FilterAssert.ListContainsPlausibleValues(sweep);

            Assert.Throws <ArgumentOutOfRangeException>(() => Dsp.AlignedLogSweep(-1, 2000, .1, Dsp.SweepAlignments.NegativeOne, 44100).ToReadOnlyList());
            Assert.Throws <ArgumentOutOfRangeException>(() => Dsp.AlignedLogSweep(20, -1, .1, Dsp.SweepAlignments.NegativeOne, 44100).ToReadOnlyList());
            Assert.Throws <ArgumentOutOfRangeException>(() => Dsp.AlignedLogSweep(20, 2000, -1, Dsp.SweepAlignments.NegativeOne, 44100).ToReadOnlyList());
            Assert.Throws <ArgumentOutOfRangeException>(() => Dsp.AlignedLogSweep(20, 2000, .1, Dsp.SweepAlignments.NegativeOne, -1).ToReadOnlyList());
            Assert.Throws <ArgumentException>(() => Dsp.AlignedLogSweep(20, 20, .1, Dsp.SweepAlignments.NegativeOne, -1).ToReadOnlyList());
        }