コード例 #1
0
        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
        }
コード例 #2
0
        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();
        }