public void ThrowOnError_NoError() { var response = new AnnotateImageResponse { TextAnnotations = { new EntityAnnotation { Description = "X" } } }; Assert.Same(response, response.ThrowOnError()); }
public void ThrowOnError_Error() { var response = new AnnotateImageResponse { Error = new Rpc.Status { Message = "Bang" } }; var exception = Assert.Throws <AnnotateImageException>(() => response.ThrowOnError()); Assert.Equal("Bang", exception.Message); Assert.Same(response, exception.Response); }