Exemplo n.º 1
0
            public async Task should_not_execute_if_not_broadcaster()
            {
                var args = new CommandArgs {
                    UserName = "******"
                };

                await Sut.Execute(ChatServiceMock.Object, args);

                HubServiceMock.Verify(x => x.SendCelebration(It.IsAny <string>()), Times.Never);
            }
Exemplo n.º 2
0
            public async Task should_celebrate_with_username_for_broadcaster()
            {
                var args = new CommandArgs {
                    IsBroadcaster = true, UserName = "******"
                };

                HubServiceMock.Setup(x => x.SendCelebration(args.UserName))
                .Returns(Task.CompletedTask)
                .Verifiable();

                await Sut.Execute(ChatServiceMock.Object, args);

                HubServiceMock.Verify(x => x.SendCelebration(args.UserName), Times.Once);
            }
Exemplo n.º 3
0
            public async Task should_send_alert_on_hub_service()
            {
                var username = "******";
                var args     = new CommandArgs {
                    UserName = username
                };

                HubServiceMock.Setup(x => x.SendAlert(username))
                .Returns(Task.CompletedTask)
                .Verifiable();

                await Sut.Execute(ChatServiceMock.Object, args);

                HubServiceMock.Verify();
            }