public void Test_timer_returns_right_value(string a) { _stopWatch.StartTimer(); Thread.Sleep(2234); string result = _stopWatch.StopTimer(); Assert.That(a, Is.EqualTo(result)); }
public void IsFull(MyStopWatch timer, Context context, IRaspberryPiStates emptyState, IRaspberryPiStates fullState, IRaspberryPiStates notDoneState) { //Console.WriteLine("NotDoneState"); if (LaserBot.Detected() == false) { //bt.SendData("NotDoneState"); context.setState(notDoneState); } if (Magnet.Detected() == false && LaserBot.Detected() == true) { //bt.Init(); string result = null; result = timer.StopTimer(); Console.WriteLine(result); //bt.SendData(result); //bt.SendData("EmptyState"); writer.JsonWriterFunc("Emptystate", result, ""); context.setState(emptyState); } if (timer.GetTime() > MAX_TIME) { throw new InvalidOperationException("TimeOut"); } }