mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-19 15:31:39 +02:00
Version 2.x
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if PROTOBUF
|
||||
//#if PROTOBUF
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
@@ -18,8 +18,8 @@ public class ProtoBufUtilsTests
|
||||
public async Task GetProtoBufMessageWithHeader_MultipleProtoFiles()
|
||||
{
|
||||
// Arrange
|
||||
var greet = await ReadProtoFileAsync("greet1.proto");
|
||||
var request = await ReadProtoFileAsync("request.proto");
|
||||
var greet = ReadProtoFile("greet1.proto");
|
||||
var request = ReadProtoFile("request.proto");
|
||||
|
||||
// Act
|
||||
var responseBytes = await ProtoBufUtils.GetProtoBufMessageWithHeaderAsync(
|
||||
@@ -35,9 +35,9 @@ public class ProtoBufUtilsTests
|
||||
Convert.ToBase64String(responseBytes).Should().Be("AAAAAAcKBWhlbGxv");
|
||||
}
|
||||
|
||||
private static Task<string> ReadProtoFileAsync(string filename)
|
||||
private string ReadProtoFile(string filename)
|
||||
{
|
||||
return File.ReadAllTextAsync(Path.Combine(Directory.GetCurrentDirectory(), "Grpc", filename));
|
||||
return File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "Grpc", filename));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if PROTOBUF
|
||||
//#if PROTOBUF
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
@@ -72,4 +72,4 @@ public class ProtoDefinitionHelperTests
|
||||
Convert.ToBase64String(responseBytes).Should().Be("AAAAAAcIARIDYWJj");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if PROTOBUF
|
||||
//#if PROTOBUF
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
@@ -501,7 +501,7 @@ message Other {
|
||||
public async Task WireMockServer_WithBodyAsProtoBuf_WithWellKnownTypes_Empty_UsingGrpcGeneratedClient()
|
||||
{
|
||||
// Arrange
|
||||
var definition = await File.ReadAllTextAsync("./Grpc/greet.proto");
|
||||
var definition = File.ReadAllText("./Grpc/greet.proto");
|
||||
|
||||
using var server = WireMockServer.Start(useHttp2: true);
|
||||
|
||||
@@ -534,7 +534,7 @@ message Other {
|
||||
// Arrange
|
||||
const int seconds = 1722301323;
|
||||
const int nanos = 12300;
|
||||
var definition = await File.ReadAllTextAsync("./Grpc/greet.proto");
|
||||
var definition = File.ReadAllText("./Grpc/greet.proto");
|
||||
|
||||
using var server = WireMockServer.Start(useHttp2: true);
|
||||
|
||||
@@ -575,7 +575,7 @@ message Other {
|
||||
// Arrange
|
||||
const int seconds = 1722301323;
|
||||
const int nanos = 12300;
|
||||
var definition = await File.ReadAllTextAsync("./Grpc/greet.proto");
|
||||
var definition = File.ReadAllText("./Grpc/greet.proto");
|
||||
|
||||
using var server = WireMockServer.Start(useHttp2: true);
|
||||
|
||||
@@ -614,7 +614,7 @@ message Other {
|
||||
public async Task WireMockServer_WithBodyAsProtoBuf_Enum_UsingGrpcGeneratedClient()
|
||||
{
|
||||
// Arrange
|
||||
var definition = await File.ReadAllTextAsync("./Grpc/greet.proto");
|
||||
var definition = File.ReadAllText("./Grpc/greet.proto");
|
||||
|
||||
using var server = WireMockServer.Start(useHttp2: true);
|
||||
|
||||
@@ -655,7 +655,7 @@ message Other {
|
||||
const int nanos = 12300;
|
||||
const string version = "test";
|
||||
const string correlationId = "correlation";
|
||||
var definition = await File.ReadAllTextAsync("./Grpc/policy.proto");
|
||||
var definition = File.ReadAllText("./Grpc/policy.proto");
|
||||
|
||||
using var server = WireMockServer.Start(useHttp2: true);
|
||||
|
||||
@@ -773,4 +773,4 @@ message Other {
|
||||
return File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "Grpc", filename));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
Reference in New Issue
Block a user