public async Task GenerateClient_With_Singel_Optional_Argument() { // arrange var sb = new StringBuilder(); var writer = new CodeWriter(sb); var generator = new OperationModelGenerator(); var descriptor = new OperationModelDescriptor( "OnReviewOperation", "Demo", "onReview", "global::Demo.IOnReview", "Queries", "Subscription", new List <OperationArgumentDescriptor> { new OperationArgumentDescriptor( "Episode", "episode", "episode", "global::StrawberryShake.Optional<global::Demo.Episode>", "Episode", true) }); // act await generator.WriteAsync(writer, descriptor); // assert sb.ToString().MatchSnapshot(); }
public async Task GenerateClient_With_No_Argument() { // arrange var sb = new StringBuilder(); var writer = new CodeWriter(sb); var generator = new OperationModelGenerator(); var descriptor = new OperationModelDescriptor( "OnReviewOperation", "Demo", "onReview", "global::Demo.IOnReview", "Queries", "Subscription", new List <OperationArgumentDescriptor>()); // act await generator.WriteAsync(writer, descriptor); // assert sb.ToString().MatchSnapshot(); }