예제 #1
0
        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;
        }
예제 #2
0
 public bool CheckParameters(IParameterChecker _)
 {
     return(true);
 }
예제 #3
0
 public bool CheckParameters(IParameterChecker _)
 {
     return(_.Check(nameof(this.Name), !string.IsNullOrWhiteSpace(this.Name), "Please provide a name for your new Todo List."));
 }
예제 #4
0
 public override bool CheckParameters(IParameterChecker _)
 {
     return(true);
 }
예제 #5
0
 public abstract bool CheckParameters(IParameterChecker _);
예제 #6
0
 public Task <bool> CheckParameters(UpdatePostTitle command, IParameterChecker _)
 {
     throw new System.NotImplementedException();
 }
예제 #7
0
 public override bool CheckParameters(IParameterChecker _)
 {
     return(_.Check(!string.IsNullOrWhiteSpace(this.NewValue), "The new value cannot be empty."));
 }
예제 #8
0
 public Task <bool> CheckParameters(RegisterUserCommand command, IParameterChecker _)
 {
     return(Task.FromResult(true));
 }
예제 #9
0
 public bool CheckParameters(IParameterChecker _)
 {
     return _.Check(() => this.FirstParameter, p => !string.IsNullOrWhiteSpace(p), FirstErrorMessage)
            && _.Check(() => this.SecondParameter, p => p >= 0, FirstErrorMessage);
 }
예제 #10
0
 public Task <bool> CheckParameters(PublishPost command, IParameterChecker _)
 {
     throw new System.NotImplementedException();
 }
 public Task <bool> CheckParameters(CreatePostAsDraft command, IParameterChecker _)
 {
     throw new System.NotImplementedException();
 }
예제 #12
0
 public Task <bool> CheckParameters(ListPosts query, IParameterChecker result)
 {
     return(Task.FromResult(true));
 }