/// <summary> /// Dependency injection constructor. /// Initializes a new instance of the <see cref="SafetyMonitorDriver" /> class. /// </summary> /// <param name="fakeResponse">Implementation of the injected dependency.</param> public FakeCommunicationChannel(string fakeResponse) { Contract.Requires(fakeResponse != null); Endpoint = new InvalidEndpoint(); Response = fakeResponse; receivedCharacters = fakeResponse.ToCharArray().ToObservable(); sendLog = new StringBuilder(); IsOpen = false; }
/// <summary> /// Dependency injection constructor. /// Initializes a new instance of the <see cref="SafetyMonitorDriver" /> class. /// </summary> /// <param name="fakeResponse">Implementation of the injected dependency.</param> public FakeCommunicationChannel(string fakeResponse) { Endpoint = new InvalidEndpoint(); Response = fakeResponse; // Concatenating Observable.Never ensures the sequence never terminates receivedCharacters = fakeResponse.ToCharArray().ToObservable().Concat(Observable.Never <char>()); sendLog = new StringBuilder(); IsOpen = false; }