Exemple #1
0
        internal void Transform_ReturnsTheResultOfThePolesFactory_Test(
            [Frozen] Mock <IPolesCoefficientsFactory> polesCoefficientsFactory, IAnalog analog,
            double cutoff, IPolesCoefficients expected, LowPassTransformer lowPassTransformer)
        {
            polesCoefficientsFactory.Setup(
                mock =>
                mock.Build(It.IsAny <double>(), It.IsAny <IReadOnlyList <Complex> >(),
                           It.IsAny <IReadOnlyList <Complex> >())).Returns(expected);

            var actual = lowPassTransformer.Transform(analog, cutoff);

            Assert.Equal(expected, actual);
        }
Exemple #2
0
        internal void Transform_CorrectlyTransformsThePCoefficient_Test(
            [Frozen] Mock <IPolesCoefficientsFactory> polesCoefficientsFactory, Mock <IAnalog> analog,
            IPolesCoefficients polesCoefficients, double cutoff, LowPassTransformer lowPassTransformer)
        {
            var expected = polesCoefficients.P.Multiply(cutoff).ToList();

            analog.SetupGet(mock => mock.Coefficients).Returns(polesCoefficients);

            lowPassTransformer.Transform(analog.Object, cutoff);

            polesCoefficientsFactory.Verify(
                mock => mock.Build(It.IsAny <double>(), expected, It.IsAny <IReadOnlyList <Complex> >()), Times.Once);
        }