public void Setup() { _uut = Substitute.For <FlightParser>(); _fakeFlightTransponderHandler = Substitute.For <IFlightTransponderHandler>(); // Set multiple return values to simulate the first item being removed from // the flightTransponderHandler. _fakeFlightTransponderHandler.GetNext().Returns <string>( x => "ATR423;39045;12932;14000;20151006213456789", x => null ); }
public void Update(IFlightTransponderHandler fth) { string next = fth.GetNext(); int i = 0; int max = 100; while (next != null) { ParseString(next); next = fth.GetNext(); i++; if (i > max) { throw new Exception("FlightParser exeeded max iterations in while loop."); } } Notify(this); }