internal void GetIirCoefficients_CorrectlyReturnsTheValueOfThePolynomialTransformer_Test( [Frozen] Mock <IDigitalPolesProvider> digitialPolesProvider, [Frozen] Mock <IPolynomialTransformer> polynomialTransformer, IPolesCoefficients polesCoefficients, IPolynomialCoefficients polynomialCoefficients, IAnalog analog, double cutoff, IirProvider iirProvider) { digitialPolesProvider.Setup(mock => mock.GetDigitalPoles(analog, cutoff, 2.0d)).Returns(polesCoefficients); polynomialTransformer.Setup(mock => mock.Transform(polesCoefficients)).Returns(polynomialCoefficients); var actual = iirProvider.GetIirCoefficients(analog, cutoff); Assert.Equal(polynomialCoefficients, actual); }
internal void Transform_CorrectlyReturnsTheResultOfThePolynomialFactory_Test( [Frozen] Mock <IPolynomialCoefficientsFactory> polynomialCoefficientsFactory, IPolesCoefficients polesCoefficients, IPolynomialCoefficients expected, PolynomialTransformer polynomialTransformer) { polynomialCoefficientsFactory.Setup( mock => mock.Build(It.IsAny <IReadOnlyList <double> >(), It.IsAny <IReadOnlyList <double> >())) .Returns(expected); var actual = polynomialTransformer.Transform(polesCoefficients); Assert.Equal(expected, actual); }
internal void Compose(IAnalog analog, double cutoff) { this.Cutoff = cutoff; this.PolynomialCoefficients = this.iirProvider.GetIirCoefficients(analog, cutoff); }