StatusCode as string (#385)

* StatusCode as string

* fix tests

* fix test

* ReplaceSingleNode

* <!--<DelaySign>true</DelaySign>-->

* Array

* add test

* Response_ProvideResponse_Handlebars_WithBodyAsJson_ResultAsHandlebarsString

* net461

* .

* fix

* target frame

* BodyAsJson

* Response_ProvideResponse_WithStatusCode

* fix build

* fix test
This commit is contained in:
Stef Heyenrath
2019-12-26 13:57:35 +01:00
committed by GitHub
parent b5795713b1
commit 120a808104
17 changed files with 236 additions and 72 deletions

View File

@@ -78,7 +78,7 @@ namespace WireMock.Net.Tests.Owin
// Assert and Verify
_optionsMock.Verify(o => o.Logger.Warn(It.IsAny<string>(), It.IsAny<object[]>()), Times.Once);
Expression<Func<ResponseMessage, bool>> match = r => r.StatusCode == 404 && ((StatusModel)r.BodyData.BodyAsJson).Status == "No matching mapping found";
Expression<Func<ResponseMessage, bool>> match = r => (int) r.StatusCode == 404 && ((StatusModel)r.BodyData.BodyAsJson).Status == "No matching mapping found";
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<IResponse>()), Times.Once);
}
@@ -99,7 +99,7 @@ namespace WireMock.Net.Tests.Owin
// Assert and Verify
_optionsMock.Verify(o => o.Logger.Error(It.IsAny<string>(), It.IsAny<object[]>()), Times.Once);
Expression<Func<ResponseMessage, bool>> match = r => r.StatusCode == 401;
Expression<Func<ResponseMessage, bool>> match = r => (int) r.StatusCode == 401;
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<IResponse>()), Times.Once);
}
@@ -120,7 +120,7 @@ namespace WireMock.Net.Tests.Owin
// Assert and Verify
_optionsMock.Verify(o => o.Logger.Error(It.IsAny<string>(), It.IsAny<object[]>()), Times.Once);
Expression<Func<ResponseMessage, bool>> match = r => r.StatusCode == 401;
Expression<Func<ResponseMessage, bool>> match = r => (int) r.StatusCode == 401;
_responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny<IResponse>()), Times.Once);
}