コード例 #1
0
 public async Task Post_ShouldReturnOkWhenEmailIsAddedToTheList()
 {
     MockGrain.Setup(m => m.AddEmailAddress(Email)).ReturnsAsync(true);
     Assert.IsType <CreatedResult>(await Controller.Post(Email));
 }
コード例 #2
0
 public async Task Post_ShouldReturnConflictWhenEmailIsAlreadyOnTheList()
 {
     MockGrain.Setup(m => m.AddEmailAddress(Email)).ReturnsAsync(false);
     Assert.IsType <ConflictObjectResult>(await Controller.Post(Email));
 }
コード例 #3
0
 public async Task Get_ShouldReturnNotFoundWhenEmailIsFound()
 {
     MockGrain.Setup(m => m.CheckEmailAddress(Email)).ReturnsAsync(false);
     Assert.IsType <NotFoundObjectResult>(await Controller.Get(Email));
 }