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()); }
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()); }
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()); }