public void testCounterSensor() { var _CounterSensor = new CounterSensor("c1"); var _Pipe = new FuncPipe<Int64, String>(_Int64 => (_Int64 + 1).ToString(), _CounterSensor); var _Result = _Pipe.Take(10).ToList(); var _Counter = 0L; foreach (var _StringValue in _Result) { Assert.AreEqual((_Counter + 1).ToString(), _StringValue); _Counter++; } Assert.AreEqual(_Counter, 10); }
public void testRandomSensor() { var _RandomSensor = new RandomSensor("r"); var _Pipe = new FuncPipe<Double, Double>(_Double => _Double + 1); _Pipe.SetSourceCollection(_RandomSensor); var _Result = _Pipe.Take(1000); Double _Sum = 0; foreach (var _Value in _Result) _Sum += _Value; var _Mean = _Sum / 1000; Assert.IsTrue(_Mean > 1.45); Assert.IsTrue(_Mean < 1.55); }
public void testCounterSensor() { var _CounterSensor = new CounterSensor("c1"); var _Pipe = new FuncPipe <Int64, String>(_Int64 => (_Int64 + 1).ToString(), _CounterSensor); var _Result = _Pipe.Take(10).ToList(); var _Counter = 0L; foreach (var _StringValue in _Result) { Assert.AreEqual((_Counter + 1).ToString(), _StringValue); _Counter++; } Assert.AreEqual(_Counter, 10); }
public void testRandomSensor() { var _RandomSensor = new RandomSensor("r"); var _Pipe = new FuncPipe <Double, Double>(_Double => _Double + 1); _Pipe.SetSourceCollection(_RandomSensor); var _Result = _Pipe.Take(1000); Double _Sum = 0; foreach (var _Value in _Result) { _Sum += _Value; } var _Mean = _Sum / 1000; Assert.IsTrue(_Mean > 1.45); Assert.IsTrue(_Mean < 1.55); }