private void Given_two_connected_sockets(ConnectedSocketsCallback callback) { var addr = TestAddr; Section($"given two connected sockets", () => { LatestPairSocket s1 = null; LatestPairSocket s2 = null; try { s1 = CreateOne <LatestPairSocket>(); s2 = CreateOne <LatestPairSocket>(); s1.Listen(addr); s2.Dial(addr); callback(s1, s2); } finally { DisposeAll(s1, s2); } }); }
private void Failure_mode_assumptions(FailureModeDelegate callback) { Section("failure modes work", () => { LatestPairSocket s = null; // We will leverage the Fixtured Done field. BasicAsyncServiceFixture svc = null; try { s = CreateOne <LatestPairSocket>(); // TODO: TBD: ditto CreateAsyncService... svc = CreateAsyncService <BasicAsyncServiceFixture>(); svc.Start(() => ++ svc.Done); Assert.Equal(0, svc.Done); callback(s, svc); } finally { DisposeAll(s, svc); } }); }