| Index: test/client_generator_test.dart
 | 
| diff --git a/test/client_generator_test.dart b/test/client_generator_test.dart
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..db58b8b1c9bcf0fa41ddc476af5d9d75e8abe7de
 | 
| --- /dev/null
 | 
| +++ b/test/client_generator_test.dart
 | 
| @@ -0,0 +1,61 @@
 | 
| +#!/usr/bin/env dart
 | 
| +// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
 | 
| +// for details. All rights reserved. Use of this source code is governed by a
 | 
| +// BSD-style license that can be found in the LICENSE file.
 | 
| +
 | 
| +library client_generator_test;
 | 
| +
 | 
| +import 'package:protoc_plugin/src/descriptor.pb.dart';
 | 
| +import 'package:protoc_plugin/src/plugin.pb.dart';
 | 
| +import 'package:protoc_plugin/protoc.dart';
 | 
| +import 'package:unittest/unittest.dart';
 | 
| +
 | 
| +ServiceDescriptorProto buildServiceDescriptor() {
 | 
| +  ServiceDescriptorProto sd = new ServiceDescriptorProto()
 | 
| +    ..name = 'Test'
 | 
| +    ..method.addAll([
 | 
| +      new MethodDescriptorProto()
 | 
| +        ..name = 'aMethod'
 | 
| +        ..inputType = 'SomeRequest'
 | 
| +        ..outputType = 'SomeReply',
 | 
| +      new MethodDescriptorProto()
 | 
| +        ..name = 'anotherMethod'
 | 
| +        ..inputType = '.foo.bar.EmptyMessage'
 | 
| +        ..outputType = '.foo.bar.AnotherReply',
 | 
| +    ]);
 | 
| +  return sd;
 | 
| +}
 | 
| +
 | 
| +void main() {
 | 
| +  test('testClientGenerator', () {
 | 
| +    // NOTE: Below > 80 cols because it is matching generated code > 80 cols.
 | 
| +    String expected = r'''
 | 
| +class TestApi {
 | 
| +  ProtobufClient _client;
 | 
| +  TestApi(this._client);
 | 
| +
 | 
| +  Future<SomeReply> aMethod(SomeRequest request) async {
 | 
| +    var resultBytes = await _client.Invoke('/Test.aMethod', request.writeToBuffer());
 | 
| +    return new SomeReply.fromBuffer(resultBytes);
 | 
| +  }
 | 
| +  Future<AnotherReply> anotherMethod(EmptyMessage request) async {
 | 
| +    var resultBytes = await _client.Invoke('/Test.anotherMethod', request.writeToBuffer());
 | 
| +    return new AnotherReply.fromBuffer(resultBytes);
 | 
| +  }
 | 
| +}
 | 
| +
 | 
| +''';
 | 
| +    var options = parseGenerationOptions(
 | 
| +        new CodeGeneratorRequest(), new CodeGeneratorResponse());
 | 
| +    var context =
 | 
| +        new GenerationContext(options, new DefaultOutputConfiguration());
 | 
| +    var fd = new FileDescriptorProto();
 | 
| +    var fg = new FileGenerator(fd, null, context);
 | 
| +    ServiceDescriptorProto sd = buildServiceDescriptor();
 | 
| +    MemoryWriter buffer = new MemoryWriter();
 | 
| +    IndentingWriter writer = new IndentingWriter('  ', buffer);
 | 
| +    ClientApiGenerator cag = new ClientApiGenerator(sd, fg, context);
 | 
| +    cag.generate(writer);
 | 
| +    expect(buffer.toString(), expected);
 | 
| +  });
 | 
| +}
 | 
| 
 |