示例#1
0
        public void CalculateSumTest()
        {
            var    arrayProcessor = new FakeStubArrayProcessor();
            Signal signal         = new Signal(arrayProcessor, new double[] { 2, 1, 6, -2, 4, 8, -1, -3, 10, 11, 11, 15, 3 });

            Assert.AreEqual(60, signal.CalculateSum());
        }
示例#2
0
        public void CalculateSumTest()
        {
            var    arrayProcessor = new Stub_ArrayProcessor();
            Signal signal         = new Signal(arrayProcessor, new double[] { 1, 1, 1, 1, 1, 1, 1 });

            Assert.AreEqual(66, signal.CalculateSum());
        }
示例#3
0
        public void CalculateSumTest()
        {
            var stub = new Mock <IArrayProcessor>();

            double[] array = new double[] { 2, 1, 6, -2, 4, 8, -1, -3, 10, 11, 11, 15, 3 };
            stub.Setup(r => r.SortAndFilter(array)).Returns(new double[] { 15, 11, 10, 8, 6, 4, 3, 2, 1 });
            Signal signal = new Signal(stub.Object, array);

            Assert.AreEqual(60, signal.CalculateSum());
        }