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 bytesResumableUpload =
          List.generate(minResumableUpload, (e) => e & 255);
  
      bool testArgumentError(e) => e is ArgumentError;
      bool testDetailedApiError(e) => e is storage.DetailedApiRequestError;
      final expectNotNull = (o) async {
        expect(o, isNotNull);
        return null;
      };
  
      void expectNormalUpload(MockClient mock, data, String objectName) {
        var bytes = data.fold([], (p, e) => p..addAll(e));
  
negative.code: 
            var bucket = api.bucket(bucketName);
            var sink = bucket.write(bucketName, length: length);
            expect(sink.done, throwsA(isDetailedApiError));
            return expectLater(
                Stream.fromIterable([bytesNormalUpload]).pipe(sink),
                throwsA(isDetailedApiError));
          }
  
          test(null) // Unknown length.
  