Exemplo n.º 1
0
        public void Setup()
        {
            Configuration           = Mock.Of <IConfiguration>();
            CancellationTokenSource = new CancellationTokenSource();
            Clients      = new Dictionary <string, ChatClient>();
            LastMessages = new Dictionary <string, List <string> >();
            InjectionConfig.ConfigureServices(Configuration);
            ChatApplication = InjectionConfig.Get <ChatApplication>();

            Task.Run(async() =>
            {
                await ChatApplication.StartAsync(CancellationTokenSource.Token);
            });
        }
Exemplo n.º 2
0
        public async Task Should_Listen_Communicator_When_Start_Application()
        {
            await ChatApplication.StartAsync();

            CommunicatorMock.Verify(mock => mock.ListenAsync(It.IsAny <CancellationToken>()));
        }