Exemplo n.º 1
0
            public async Task should_not_throw()
            {
                ChatServiceMock.Setup(x => x.GetUptime())
                .ReturnsAsync(TimeSpan.FromMinutes(97));
                ChatServiceMock.Setup(x => x.SendMessage(It.IsAny <string>()))
                .ReturnsAsync(true);

                await Sut.Execute(ChatServiceMock.Object, new CommandArgs());
            }
Exemplo n.º 2
0
            public async Task should_format_negative_timespan_properly()
            {
                ChatServiceMock.Setup(x => x.GetUptime())
                .ReturnsAsync(TimeSpan.FromMinutes(-97));
                string chatMessage = null;

                ChatServiceMock.Setup(x => x.SendMessage(It.IsAny <string>()))
                .ReturnsAsync(true)
                .Callback <string>(msg => chatMessage = msg);

                await Sut.Execute(ChatServiceMock.Object, new CommandArgs());

                chatMessage.ShouldContain("01:37:00");
            }