コード例 #1
0
        public async Task OnInitializationAsync_Is_Invoked()
        {
            var mock = new MockCommand();
            await mock.ExecuteAsync();

            mock.OnInitializationAsyncWasInvoked.ShouldBe(true);
        }
コード例 #2
0
        public async Task OnExecuteAsync_Is_Invoked_When_No_Errors_Exist()
        {
            var mock = new MockCommand();
            await mock.ExecuteAsync();

            mock.OnExecuteAsyncWasInvoked.ShouldBe(true);
        }
コード例 #3
0
        public async Task OnExecuteAsyncIsInvokedWhenNoErrorsExist()
        {
            var mock = new MockCommand();
            await mock.ExecuteAsync();

            mock.OnExecuteAsyncWasInvoked.ShouldBe(true);
        }
コード例 #4
0
        public async Task OnExecuteAsync_Is_Not_Invoked_When_Errors_Exist()
        {
            var mock = new MockCommand {
                Errors = new[] { new ValidationResult("Object doesn't exist") }
            };
            await mock.ExecuteAsync();

            mock.OnExecuteAsyncWasInvoked.ShouldBe(false);
        }
コード例 #5
0
        public async Task OnExecuteAsyncIsNotInvokedWhenErrorsExist()
        {
            var mock = new MockCommand();

            mock.Errors = new[] { new ValidationResult("Object doesn't exist") };
            await mock.ExecuteAsync();

            mock.OnExecuteAsyncWasInvoked.ShouldBe(false);
        }
コード例 #6
0
ファイル: CommandTests.cs プロジェクト: ndphuong/Peasy.NET
 public async Task OnExecuteAsyncIsNotInvokedWhenErrorsExist()
 {
     var mock = new MockCommand();
     mock.Errors = new[] { new ValidationResult("Object doesn't exist") };
     await mock.ExecuteAsync();
     mock.OnExecuteAsyncWasInvoked.ShouldBe(false);
 }
コード例 #7
0
ファイル: CommandTests.cs プロジェクト: ndphuong/Peasy.NET
  public async Task OnExecuteAsyncIsInvokedWhenNoErrorsExist()
  {
      var mock = new MockCommand();
      await mock.ExecuteAsync();
      mock.OnExecuteAsyncWasInvoked.ShouldBe(true);
 } 
コード例 #8
0
ファイル: CommandTests.cs プロジェクト: ndphuong/Peasy.NET
 public async Task OnInitializationAsyncIsInvoked()
 {
     var mock = new MockCommand();
     await mock.ExecuteAsync();
     mock.OnInitializationAsyncWasInvoked.ShouldBe(true);
 }