Skip to content

Commit

Permalink
Update TestRequests.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
maurizuki committed Nov 8, 2023
1 parent 7345b02 commit 9bfa287
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/ECB.Data.ExchangeRates.Tests/TestRequests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ namespace ECB.Data.ExchangeRates.Tests;
public class TestRequests
{
private const string BaseAddress = "https://data-api.ecb.europa.eu/service/data/EXR/";

private const string DefaultResponseMessageContent = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<message:GenericData xmlns:message=""http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message"" xmlns:generic=""http://www.sdmx.org/resources/sdmxml/schemas/v2_1/data/generic""></message:GenericData>";

[Theory]
[InlineData(new string[0], BaseAddress + "D..EUR.SP00.A?detail=dataOnly&lastNObservations=1")]
Expand All @@ -41,7 +44,7 @@ public async Task GetDailyAverageRatesAsync1(string[] currencies, string expecte

Assert.Equal(expectedRequestUri, request.RequestUri?.ToString());

return new HttpResponseMessage();
return new HttpResponseMessage{ Content = new StringContent(DefaultResponseMessageContent) };
}
)
);
Expand All @@ -63,7 +66,7 @@ public async Task GetDailyAverageRatesAsync2(string[] currencies, string expecte

Assert.Equal(expectedRequestUri, request.RequestUri?.ToString());

return new HttpResponseMessage();
return new HttpResponseMessage { Content = new StringContent(DefaultResponseMessageContent) };
}
)
);
Expand All @@ -85,7 +88,7 @@ public async Task GetDailyAverageRatesAsync3(string[] currencies, string expecte

Assert.Equal(expectedRequestUri, request.RequestUri?.ToString());

return new HttpResponseMessage();
return new HttpResponseMessage { Content = new StringContent(DefaultResponseMessageContent) };
}
)
);
Expand All @@ -111,7 +114,7 @@ public async Task GetMonthlyAverageRatesAsync1(string[] currencies, string expec

Assert.Equal(expectedRequestUri, request.RequestUri?.ToString());

return new HttpResponseMessage();
return new HttpResponseMessage { Content = new StringContent(DefaultResponseMessageContent) };
}
)
);
Expand All @@ -133,7 +136,7 @@ public async Task GetMonthlyAverageRatesAsync2(string[] currencies, string expec

Assert.Equal(expectedRequestUri, request.RequestUri?.ToString());

return new HttpResponseMessage();
return new HttpResponseMessage{ Content = new StringContent(DefaultResponseMessageContent) };
}
)
);
Expand All @@ -155,7 +158,7 @@ public async Task GetAnnualAverageRatesAsync1(string[] currencies, string expect

Assert.Equal(expectedRequestUri, request.RequestUri?.ToString());

return new HttpResponseMessage();
return new HttpResponseMessage{ Content = new StringContent(DefaultResponseMessageContent) };
}
)
);
Expand All @@ -177,7 +180,7 @@ public async Task GetAnnualAverageRatesAsync2(string[] currencies, string expect

Assert.Equal(expectedRequestUri, request.RequestUri?.ToString());

return new HttpResponseMessage();
return new HttpResponseMessage{ Content = new StringContent(DefaultResponseMessageContent) };
}
)
);
Expand Down

0 comments on commit 9bfa287

Please sign in to comment.