public async Task TestOutput() { HttpResponseMessage m = await _client.GetAsync("/Example/Output"); Assert.DoesNotThrow(() => m.EnsureSuccessStatusCode()); Assert.AreEqual(ProtobufFormatterUtils.BinContentType, m.Content.Headers.ContentType.ToString()); ExampleProto proto = ExampleProto.Parser.ParseFrom(await m.Content.ReadAsByteArrayAsync()); Assert.AreEqual(ExampleProto.Output, proto); }
public IActionResult Input([FromBody] ExampleProto proto) { return(proto.Equals(ExampleProto.Input) ? Ok() : (IActionResult)BadRequest()); }