Beispiel #1
0
        public async Task ShouldCallHandleAsync()
        {
            var textHandlerService = new TextHandlerService(new List <ITextHandler>
            {
                trueHandler.Object
            });

            await textHandlerService.HandleTextAsync(user, chat, TestText);

            trueHandler.Verify(i => i.HandleAsync(user, chat, TestText));
        }
Beispiel #2
0
        public void WithNullUserShouldThrowException()
        {
            var textHandlerService = new TextHandlerService(new List <ITextHandler>());

            Assert.ThrowsAsync <ArgumentNullException>(() => textHandlerService.HandleTextAsync(null, chat, TestText));
        }
Beispiel #3
0
        public void WithEmptyTextShouldThrowException()
        {
            var textHandlerService = new TextHandlerService(new List <ITextHandler>());

            Assert.ThrowsAsync <ArgumentNullException>(() => textHandlerService.HandleTextAsync(user, chat, ""));
        }