public void Should_return_NotAvailable_on_exception() { _reader.Stub(x => x.Exists("")).IgnoreArguments().Throw(new IOException()); var artistHandler = new ArtistHandler(_writer, _reader, _operationOutput); var operationResult = artistHandler.Delete(new Artist { Id = 1 }); Assert.That(operationResult.StatusCode, Is.EqualTo(405)); }
public void Should_return_NotFound_with_incorrect_artist() { _writer.Stub(x => x.DeleteFile(0)).IgnoreArguments().Throw(new FileNotFoundException()); var artistHandler = new ArtistHandler(_writer, _reader, _operationOutput); var operationResult = artistHandler.Delete(new Artist{Id=1}); Assert.That(operationResult.StatusCode, Is.EqualTo(404)); }
public void Should_return_NoContent_on_successful_delete() { _reader.Stub(x => x.Exists("")).IgnoreArguments().Return(true); var artistHandler = new ArtistHandler(_writer, _reader, _operationOutput); var operationResult = artistHandler.Delete(new Artist { Id = 1 }); Assert.That(operationResult.StatusCode, Is.EqualTo(204)); }