public void SetCommand_GenericWithEventArgsAndCommandParameter_Executes(bool canExecute, object commandParameter)
        {
            // arrange
            _command.CanExecute(Arg.Any <string>()).Returns(canExecute);

            // act
            _obj.SetCommand <string, string>(nameof(_obj.GenericStringEvent), _command, (string)commandParameter);

            // assert
            _obj.RaiseGenericStringEvent("event args will be ignored");
            AssertHelpers.ReceivedCommandInterface(_command, canExecute, commandParameter);
        }
        public void SetCommand_GenericWithNullBinding_Executes(bool canExecute)
        {
            // arrange
            _command.CanExecute(Arg.Any <string>()).Returns(canExecute);

            // act
            _obj.SetCommand <string>(nameof(_obj.SimpleEvent), _command, null as Binding);

            // assert
            _obj.RaiseSimpleEvent();
            AssertHelpers.ReceivedCommandInterface(_command, canExecute, null);
        }
        public void SetCommand_GenericWithCommandParameter_Executes(bool canExecute, string commandParameter)
        {
            // arrange
            _command.CanExecute(Arg.Any <string>()).Returns(canExecute);

            // act
            _obj.SetCommand(nameof(_obj.SimpleEvent), _command, commandParameter);

            // assert
            _obj.RaiseSimpleEvent();
            AssertHelpers.ReceivedCommandInterface(_command, canExecute, commandParameter);
        }
        public void SetCommand_SimpleSetCommandWithCanExecute_Executes(bool canExecute)
        {
            // arrange
            _command.CanExecute(Arg.Any <object>()).Returns(canExecute);

            // act
            _obj.SetCommand(nameof(_obj.SimpleEvent), _command);

            // assert
            _obj.RaiseSimpleEvent();
            AssertHelpers.ReceivedCommandInterface(_command, canExecute, null);
        }
        public void SetCommandWithDisposing_SimpleCommand_SetsCommandCorrect(bool canExecute)
        {
            // arrange
            _command.CanExecute(Arg.Any <string>()).Returns(canExecute);

            // act
            _obj.SetCommandWithDisposing(nameof(_obj.SimpleEvent), _command);

            // assert
            _obj.RaiseSimpleEvent();
            AssertHelpers.ReceivedCommandInterface(_command, canExecute, null);
        }
        public void SetCommand_GenericWithEventArgs_Executes(bool canExecute, object commandParameter)
        {
            // arrange
            _commandGeneric.CanExecute(Arg.Any <object>()).Returns(canExecute);

            // act
            // ReSharper disable once RedundantTypeArgumentsOfMethod
            _obj.SetCommand <string>(nameof(_obj.GenericStringEvent), _commandGeneric);

            // assert
            _obj.RaiseGenericStringEvent((string)commandParameter);
            AssertHelpers.ReceivedCommandInterface(_commandGeneric, canExecute, commandParameter);
        }