anchor.diff:        withMockClient((mock, api) {
           var bucket = api.bucket(bucketName);
           var sink = bucket.write(bucketName);
  -        sink.done
  -            .then<Null>((_) => throw 'Unexpected')
  -            .catchError(expectAsync1(expectNotNull), test: testArgumentError);
  +        expect(sink.done, throwsArgumentError);
           var stream = Stream.fromIterable([
             [1, 2, 3]
           ]);
           sink.addStream(stream).then((_) {
             sink.addError(ArgumentError());
  -          sink
  -              .close()
  -              .catchError(expectAsync1(expectNotNull), test: testArgumentError);
  +          expect(sink.close(), throwsArgumentError);
           });
         });
       });
  
positive.code: 
            var bucket = api.bucket(bucketName);
            var sink = bucket.write(bucketName, length: length);
            sink.done.then<Null>((_) => throw 'Unexpected').catchError(
                expectAsync1(expectNotNull),
                test: (e) => e is String || e is storage.ApiRequestError);
            return Stream<List<int>>.fromIterable(data)
                .pipe(sink)
                .then<Null>((_) => throw 'Unexpected')
                .catchError(expectAsync1(expectNotNull),
                    test: (e) => e is String || e is storage.ApiRequestError);
          }
  
          test([bytesResumableUpload], bytesResumableUpload.length + 1)
  
negative.code: 
            var bucket = api.bucket(bucketName);
            var sink = bucket.write(bucketName);
            expect(sink.done, throwsA(isDetailedApiError));
            return expectLater(
                Stream.fromIterable([bytesResumableUpload]).pipe(sink),
                throwsA(isDetailedApiError));
          }
  
          test(null) // Unknown length.
  