public ParameterCheckerTest() { #region 创建并初始化假的TestFlowRunner Type runnerType = typeof(TestflowRunner); //默认options TestflowRunnerOptions option = new TestflowRunnerOptions(); //创建假的TestFlowRunner FakeTestflowRunner fakeTestflowRunner = new FakeTestflowRunner(option); Type intType = typeof(int); //用反射将获取private fieldInfo,然后赋值fake FieldInfo fieldInfo = runnerType.GetField("_runnerInst", BindingFlags.Static | BindingFlags.NonPublic); fieldInfo.SetValue(null, fakeTestflowRunner); fakeTestflowRunner.Initialize(); #endregion _parameterChecker = fakeTestflowRunner.ParameterChecker; _sequenceManager = fakeTestflowRunner.SequenceManager; _interfaceManager = fakeTestflowRunner.ComInterfaceManager; }
public bool CheckParameters(IParameterChecker _) { return(true); }
public bool CheckParameters(IParameterChecker _) { return(_.Check(nameof(this.Name), !string.IsNullOrWhiteSpace(this.Name), "Please provide a name for your new Todo List.")); }
public override bool CheckParameters(IParameterChecker _) { return(true); }
public abstract bool CheckParameters(IParameterChecker _);
public Task <bool> CheckParameters(UpdatePostTitle command, IParameterChecker _) { throw new System.NotImplementedException(); }
public override bool CheckParameters(IParameterChecker _) { return(_.Check(!string.IsNullOrWhiteSpace(this.NewValue), "The new value cannot be empty.")); }
public Task <bool> CheckParameters(RegisterUserCommand command, IParameterChecker _) { return(Task.FromResult(true)); }
public bool CheckParameters(IParameterChecker _) { return _.Check(() => this.FirstParameter, p => !string.IsNullOrWhiteSpace(p), FirstErrorMessage) && _.Check(() => this.SecondParameter, p => p >= 0, FirstErrorMessage); }
public Task <bool> CheckParameters(PublishPost command, IParameterChecker _) { throw new System.NotImplementedException(); }
public Task <bool> CheckParameters(CreatePostAsDraft command, IParameterChecker _) { throw new System.NotImplementedException(); }
public Task <bool> CheckParameters(ListPosts query, IParameterChecker result) { return(Task.FromResult(true)); }