public Endpoint(Hub.IFactory hubFactory, Registration.IFactory registrationFactory) { _debug = new ObservableStreamWriter(); _hubFactory = hubFactory; _registrationFactory = registrationFactory; _registrations = new Registration.Collection(); }
private async Task RunTest(Func <Hub.IFactory, Hub.IInstance, Registration.IFactory, Endpoint, Task> test) { Hub.IInstance hub = A.Fake <Hub.IInstance>(); A.CallTo(() => hub.Start()).Returns(TaskEx.Done); Hub.IFactory hubFactory = A.Fake <Hub.IFactory>(); A.CallTo(() => hubFactory.Create()).Returns(hub); Registration.IFactory registrationFactory = A.Fake <Registration.IFactory>(); Endpoint subject = new Endpoint(hubFactory, registrationFactory); await test(hubFactory, hub, registrationFactory, subject); }