public void ShouldAddCommand() { Sut.AddCommand(MockedUserCommand1.Object); Assert.Single(Sut.Commands); Assert.Equal(MockedUserCommand1.Object, Sut.Commands[MockedUserCommand1.Object.Name]); }
public WhenUserCommandReceived() { Sut .AddCommand(MockedUserCommand1.Object) .AddCommand(MockedUserCommand2.Object); ChatMessage = ChatMessageBuilder .Create() .Build(); Sut.Enable(MockedUserCommand1.Object.Name); var userCommandName = MockedUserCommand1.Object.Name; UserCommandArgs = new OnUserCommandReceivedArgs(ChatMessage, Array.Empty <String>()); var userCommandArgs = UserCommandArgs; MockedUserCommandValidator .Setup(x => x.TryValidateCommand(ChatMessage, out userCommandName, out userCommandArgs)) .Returns(true); MessageArgs = new OnMessageReceivedArgs() { ChatMessage = ChatMessage }; MockedTwitchClient.Raise(x => x.OnMessageReceived += null, MessageArgs); }
public void ShouldReturnSetting() { Sut.AddCommand(MockedSetting1.Object); Sut.AddCommand(MockedCommand.Object); Assert.Contains(MockedSetting1.Object, Sut.Settings.Disabled); Assert.Single(Sut.Settings.Disabled); }
public WhenAllSettingsAreDisabled() { Sut .AddCommand(MockedSetting1.Object) .AddCommand(MockedSetting2.Object) .AddCommand(MockedSetting3.Object) .AddCommand(MockedCommand.Object); }
public WhenGettingStatus() { Sut .AddCommand(MockedSetting2.Object) .AddCommand(MockedSetting1.Object) .AddCommand(MockedSetting3.Object) .AddCommand(MockedCommand.Object); }
public WhenGettingProperty() { MockedSetting = new Mock <ISetting>().SetupAllProperties(); MockedSetting .Setup(x => x.Name) .Returns(Name.From(Guid.NewGuid().ToString())); Sut.AddCommand(MockedSetting.Object); }
public void ShouldAddUserCommand() { Sut.AddCommand(MockedUserCommand1.Object); Assert.Single(Sut.Commands); Assert.Equal(MockedUserCommand1.Object, Sut.Commands[MockedUserCommand1.Object.Name]); Assert.Single(Sut.Settings.Disabled); Assert.Contains(MockedUserCommand1.Object, Sut.Settings.Disabled); Assert.Contains(MockedUserCommand1.Object, Sut.UserCommands.Values); Assert.DoesNotContain(MockedUserCommand1.Object, Sut.Settings.Enabled); }
public void ShouldDisableAllSettings() { Sut.AddCommand(MockedSetting1.Object); Sut.AddCommand(MockedCommand.Object); Sut.AddCommand(MockedSetting2.Object); Sut.Settings.Enable(MockedSetting1.Object.Name); Sut.DisableAllSettings(); Assert.Empty(Sut.Settings.Enabled); Assert.Contains(MockedSetting1.Object, Sut.Settings.Disabled); Assert.Contains(MockedSetting2.Object, Sut.Settings.Disabled); }
public WhenSettingProperty() { Sut.AddCommand(MockedSetting1.Object); }