public async Task ShouldRegisterEvent_WhenInitializedWithCorrectArgs() { // Arrange var stub = new StubProxy() { InspectRegister = (e, uuid) => { Assert.Equal(StubProxy.TEST_EVENT, e); Assert.Equal(uuid, uuid); } }; // Act await ConnectionManager.Initialize(StubProxy.ValidCommandLineArguments, null, stub) .StartAsync(CancellationToken.None); // Assert }
public async Task ShouldRegisterEvent_WhenInitializedWithCorrectArgs() { // Arrange var stub = new StubProxy() { InspectRegister = (e, uuid) => { Assert.Equal(StubProxy.TEST_EVENT, e); Assert.Equal(uuid, uuid); } }; // Act var tokenSource = new CancellationTokenSource(); var task = ConnectionManager.Initialize(StubProxy.ValidCommandLineArguments, null, stub) .StartAsync(tokenSource.Token); // Assert Assert.Null(task.Exception); tokenSource.Cancel(); }