public async Task When_ResourceOwner_Does_Not_Exist_Then_ReturnsFalse() { const string subject = "invalid_subject"; InitializeFakeObjects(); var result = await _resourceOwnerRepositoryStub.Delete(subject, CancellationToken.None) .ConfigureAwait(false); Assert.False(result); }
public async Task <IActionResult> Delete(string id, CancellationToken cancellationToken) { if (!await _resourceOwnerRepository.Delete(id, cancellationToken).ConfigureAwait(false)) { return(BadRequest( new ErrorDetails { Title = ErrorCodes.UnhandledExceptionCode, Detail = Strings.TheResourceOwnerCannotBeRemoved, Status = HttpStatusCode.BadRequest })); } return(Ok()); }