public void NoSuitableMethodActionForCommandGivesAnError() { var commandProperty = Reflector.Property <ViewModelNoValidActionName>(x => x.ShowChildCommand); var methods = new CommandConvention() .Get(typeof(ViewModelNoValidActionName), commandProperty); methods.Errors.Should().HaveCount(2); }
public void GetActionMethodFromViewModelByConvention() { var methods = new CommandConvention() .Get(typeof(ViewModel1), Reflector.Property <ViewModel1>(x => x.ShowChildCommand)); methods.ActionMethod.MethodInfo.Name .Should().Be("ShowChild", "Cannot find the associated method to the command."); methods.CanExecuteMethod.MethodInfo.Name .Should().Be("CanShowChild", "Cannot find the associated can method to the command."); methods.ActionMethod.IsAsync .Should().BeTrue("The discovered command should be identified as async."); }