public void CanExecute_PassesArgument_GenericClass()
        {
            MockCommandHandler <MockArgumentClass> handler = new MockCommandHandler <MockArgumentClass>();
            DelegateCommand <MockArgumentClass>    command = new DelegateCommand <MockArgumentClass>(handler.Execute, handler.CanExecute);
            MockArgumentClass argument = new MockArgumentClass();

            command.CanExecute(argument);

            Assert.Equal <MockArgumentClass>(new[] { argument }, handler.ArgumentList);
        }
Example #2
0
        public void CanExecute_PassesArgument_GenericClass()
        {
            MockCommandHandler<MockArgumentClass> handler = new MockCommandHandler<MockArgumentClass>();
            DelegateCommand<MockArgumentClass> command = new DelegateCommand<MockArgumentClass>(handler.Execute, handler.CanExecute);
            MockArgumentClass argument = new MockArgumentClass();

            command.CanExecute(argument);

            CollectionAssert.AreEqual(new[] { argument }, (ICollection)handler.ArgumentList);
        }
        public void Execute_PassesArgument_GenericClass()
        {
            MockCommandHandler<MockArgumentClass> handler = new MockCommandHandler<MockArgumentClass>();
            DelegateCommand<MockArgumentClass> command = new DelegateCommand<MockArgumentClass>(handler.Execute);
            MockArgumentClass argument = new MockArgumentClass();

            command.Execute(argument);

            Assert.Equal<MockArgumentClass>(new[] { argument }, handler.ArgumentList);
        }