public void CalculateDia_sinusWithAmplityde5_diaIsminus5() { DAQSettingsDTO daq = new DAQSettingsDTO(); AutoResetEvent _autoresetevent = new AutoResetEvent(false); ConcurrentQueue <RawData> _dataQueues = new ConcurrentQueue <RawData>(); DeQueue dequeue = new DeQueue(_dataQueues, daq); var alarm = new MuckAlarm(); uut = new CalcDia(daq, _autoresetevent, dequeue, alarm); List <double> data = Generate.Sinusoidal(3000, 1000, 1, -5, 0, 0, 0).ToList(); uut.CalculateDia(data); Assert.That(uut.GetDia(), Is.EqualTo(-5)); }
public void CalculateDia_sinusWithAmplityde5og4_subakutalarmIsCalled() { DAQSettingsDTO daq = new DAQSettingsDTO(); AutoResetEvent _autoresetevent = new AutoResetEvent(false); ConcurrentQueue <RawData> _dataQueues = new ConcurrentQueue <RawData>(); DeQueue dequeue = new DeQueue(_dataQueues, daq); var alarm = new MuckAlarm(); uut = new CalcDia(daq, _autoresetevent, dequeue, alarm); List <double> data1 = Generate.Sinusoidal(3000, 1000, 1, 5, 0, 0, 0).ToList(); List <double> data2 = Generate.Sinusoidal(3000, 1000, 1, 4, 0, 0, 0).ToList(); uut.CalculateDia(data1); uut.CalculateDia(data2); Assert.That(alarm.CheckSubakutAlarmDiaWasCalled, Is.EqualTo(true)); }