Commit f5c726bb authored by Andreas Müller's avatar Andreas Müller
Browse files

Added Changelog, small UnitTest fixes

parent 841f1058
......@@ -43,7 +43,7 @@ namespace AMWD.Net.Api.PowerAlarm.Test
public async Task ShouldThrowExceptionOnMissingApikey()
{
// arrange
var api = new PowerAlarmApi();
using var api = new PowerAlarmApi();
// act + assert
try
......
......@@ -20,6 +20,7 @@ namespace AMWD.Net.Api.PowerAlarm.Test
[TestInitialize]
public virtual void InitializeTest()
{
requestCallback = null;
httpResponseMessage = new HttpResponseMessage
{
StatusCode = HttpStatusCode.OK
......@@ -37,7 +38,11 @@ namespace AMWD.Net.Api.PowerAlarm.Test
httpMessageHandlerMock = new Mock<HttpMessageHandler>();
httpMessageHandlerMock.Protected()
.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
.Callback<HttpRequestMessage, CancellationToken>(async (req, _) => requestCallback = await req.Content.ReadAsStringAsync())
.Callback<HttpRequestMessage, CancellationToken>(async (req, _) =>
{
if (req.Content != null)
requestCallback = await req.Content.ReadAsStringAsync();
})
.ReturnsAsync(httpResponseMessage);
httpClient = new HttpClient(httpMessageHandlerMock.Object, disposeHandler: false);
......
......@@ -33,6 +33,7 @@ namespace AMWD.Net.Api.PowerAlarm
/// </summary>
public PowerAlarmApi()
{
isExternalClient = false;
httpClient = new HttpClient();
}
......
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased](https://git.am-wd.de/andreasmueller/poweralarm-api/compare/v1.0.0...main) - 0000-00-00
### Added
- Changelog
## [v1.0.0](https://git.am-wd.de/andreasmueller/poweralarm-api/commits/v1.0.0) - 2022-01-09
Initial release
......@@ -12,12 +12,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.gitlab-ci.yml = .gitlab-ci.yml
scripts\build.cmd = scripts\build.cmd
scripts\build.sh = scripts\build.sh
CHANGELOG.md = CHANGELOG.md
CodeMaid.config = CodeMaid.config
LICENSE.txt = LICENSE.txt
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMWD.Net.Api.PowerAlarm.Test", "AMWD.Net.Api.PowerAlarm.Test\AMWD.Net.Api.PowerAlarm.Test.csproj", "{55477780-2A68-46BE-8A9C-E55F7BB5C80E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AMWD.Net.Api.PowerAlarm.Test", "AMWD.Net.Api.PowerAlarm.Test\AMWD.Net.Api.PowerAlarm.Test.csproj", "{55477780-2A68-46BE-8A9C-E55F7BB5C80E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment