mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-23 09:30:59 +01:00
fix AppVeyor tests
This commit is contained in:
12
appveyor.yml
12
appveyor.yml
@@ -36,14 +36,14 @@ build_script:
|
||||
|
||||
- dotnet pack -c %CONFIGURATION% --no-build --version-suffix %LABEL% -o .\artifacts .\src\WireMock.Net\project.json
|
||||
|
||||
test_script:
|
||||
#test_script:
|
||||
# test WireMock.Net.Tests
|
||||
- cd .\test\WireMock.Net.Tests
|
||||
- dotnet test -c %CONFIGURATION% --no-build
|
||||
- cd ..
|
||||
- cd ..
|
||||
# - cd .\test\WireMock.Net.Tests
|
||||
# - dotnet test -c %CONFIGURATION% --no-build
|
||||
# - cd ..
|
||||
# - cd ..
|
||||
|
||||
after_test:
|
||||
test_script:
|
||||
- nuget.exe install OpenCover -ExcludeVersion
|
||||
- nuget.exe install coveralls.net -ExcludeVersion
|
||||
# - OpenCover\tools\OpenCover.Console.exe -register:user -target:nunit3-console.exe -targetargs:"\".\test\WireMock.Net.Tests\bin\%CONFIGURATION%\net452\win7-x64\WireMock.Net.Tests.dll\" --result=myresults.xml;format=AppVeyor" -returntargetcode -filter:"+[WireMock.Net]*" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -output:coverage.xml
|
||||
|
||||
@@ -20,6 +20,16 @@ namespace WireMock.Net.Tests
|
||||
{
|
||||
private FluentMockServer _server;
|
||||
|
||||
// For for AppVeyor + OpenCover
|
||||
private string GetCurrentFolder()
|
||||
{
|
||||
string current = Directory.GetCurrentDirectory();
|
||||
if (!current.EndsWith("WireMock.Net.Tests"))
|
||||
return Path.Combine(current, "test", "WireMock.Net.Tests");
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FluentMockServer_ReadStaticMapping_WithNonGuidFilename()
|
||||
{
|
||||
@@ -28,7 +38,7 @@ namespace WireMock.Net.Tests
|
||||
|
||||
_server = FluentMockServer.Start();
|
||||
|
||||
string folder = Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", "documentdb_root.json");
|
||||
string folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings", "documentdb_root.json");
|
||||
_server.ReadStaticMapping(folder);
|
||||
|
||||
var mappings = _server.Mappings.ToArray();
|
||||
@@ -46,7 +56,7 @@ namespace WireMock.Net.Tests
|
||||
string guid = "00000002-ee28-4f29-ae63-1ac9b0802d86";
|
||||
|
||||
_server = FluentMockServer.Start();
|
||||
string folder = Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", guid + ".json");
|
||||
string folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings", guid + ".json");
|
||||
_server.ReadStaticMapping(folder);
|
||||
|
||||
var mappings = _server.Mappings.ToArray();
|
||||
@@ -307,7 +317,7 @@ namespace WireMock.Net.Tests
|
||||
watch.Stop();
|
||||
|
||||
// then
|
||||
Check.That(watch.ElapsedMilliseconds).IsGreaterThan(200);
|
||||
Check.That(watch.ElapsedMilliseconds).IsStrictlyGreaterThan(200);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -327,7 +337,7 @@ namespace WireMock.Net.Tests
|
||||
watch.Stop();
|
||||
|
||||
// then
|
||||
Check.That(watch.ElapsedMilliseconds).IsGreaterThan(200);
|
||||
Check.That(watch.ElapsedMilliseconds).IsStrictlyGreaterThan(200);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
|
||||
@@ -334,7 +334,7 @@ namespace WireMock.Net.Tests
|
||||
|
||||
// then
|
||||
var requestMatchResult = new RequestMatchResult();
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsLessThan(1.0);
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsStrictlyLessThan(1.0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -350,7 +350,7 @@ namespace WireMock.Net.Tests
|
||||
|
||||
// then
|
||||
var requestMatchResult = new RequestMatchResult();
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsLessThan(1.0).And.IsGreaterThan(0.5);
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsStrictlyLessThan(1.0).And.IsStrictlyGreaterThan(0.5);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -366,7 +366,7 @@ namespace WireMock.Net.Tests
|
||||
|
||||
// then
|
||||
var requestMatchResult = new RequestMatchResult();
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsLessThan(0.1).And.IsGreaterThan(0.05);
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsStrictlyLessThan(0.1).And.IsStrictlyGreaterThan(0.05);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -2,19 +2,24 @@
|
||||
"version": "1.0.0-*",
|
||||
"authors": [ "Stef Heyenrath" ],
|
||||
|
||||
"buildOptions": { "debugType": "portable" },
|
||||
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Testing.Abstractions": "1.0.0-preview2-003121",
|
||||
"Moq": "4.7.1",
|
||||
"NUnit": "3.6.1",
|
||||
"dotnet-test-nunit": "3.4.0-beta-3",
|
||||
"NFluent": "2.0.0-alpha",
|
||||
"SimMetrics.Net": "1.0.1.0",
|
||||
"WireMock.Net": { "target": "project" }
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"net452": {
|
||||
"frameworkAssemblies": {
|
||||
"System.Net.Http": { "type": "build" }
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"dotnet-test-nunit": "3.4.0-beta-3",
|
||||
"Moq": "4.7.0",
|
||||
"NFluent": "1.3.1",
|
||||
"NUnit": "3.6.0",
|
||||
"SimMetrics.Net": "1.0.1.0",
|
||||
"WireMock.Net": { "target": "project" }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user