mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-17 15:46:46 +01:00
update tests (#21)
This commit is contained in:
@@ -3,7 +3,6 @@ os: Visual Studio 2015
|
||||
version: 1.0.0.{build}
|
||||
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
|
||||
platform: Any CPU
|
||||
@@ -39,7 +38,8 @@ build_script:
|
||||
|
||||
test_script:
|
||||
# test WireMock.Net.Tests
|
||||
- dotnet test -c %CONFIGURATION% --no-build .\test\WireMock.Net.Tests
|
||||
- cd .\test\WireMock.Net.Tests
|
||||
- dotnet test -c %CONFIGURATION% --no-build
|
||||
|
||||
after_test:
|
||||
- nuget.exe install OpenCover -ExcludeVersion
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace WireMock.Server
|
||||
/// </summary>
|
||||
public partial class FluentMockServer
|
||||
{
|
||||
private const string AdminMappingsFolder = @"\__admin\mappings\";
|
||||
private static readonly string AdminMappingsFolder = Path.Combine("__admin", "mappings");
|
||||
private const string AdminMappings = "/__admin/mappings";
|
||||
private const string AdminRequests = "/__admin/requests";
|
||||
private const string AdminSettings = "/__admin/settings";
|
||||
@@ -45,12 +45,12 @@ namespace WireMock.Server
|
||||
public void ReadStaticMappings([CanBeNull] string folder = null)
|
||||
{
|
||||
if (folder == null)
|
||||
folder = Directory.GetCurrentDirectory() + AdminMappingsFolder;
|
||||
folder = Path.Combine(Directory.GetCurrentDirectory(), AdminMappingsFolder);
|
||||
|
||||
if (!Directory.Exists(folder))
|
||||
return;
|
||||
|
||||
foreach (string filename in Directory.EnumerateFiles(Directory.GetCurrentDirectory() + AdminMappingsFolder))
|
||||
foreach (string filename in Directory.EnumerateFiles(folder).OrderBy(f => f))
|
||||
{
|
||||
ReadStaticMapping(filename);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@@ -27,7 +28,8 @@ namespace WireMock.Net.Tests
|
||||
|
||||
_server = FluentMockServer.Start();
|
||||
|
||||
_server.ReadStaticMapping("./__admin/mappings/documentdb_root.json");
|
||||
string folder = Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", "documentdb_root.json");
|
||||
_server.ReadStaticMapping(folder);
|
||||
|
||||
var mappings = _server.Mappings.ToArray();
|
||||
Check.That(mappings).HasSize(1);
|
||||
@@ -44,7 +46,8 @@ namespace WireMock.Net.Tests
|
||||
string guid = "00000002-ee28-4f29-ae63-1ac9b0802d86";
|
||||
|
||||
_server = FluentMockServer.Start();
|
||||
_server.ReadStaticMapping("./__admin/mappings/" + guid + ".json");
|
||||
string folder = Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", guid + ".json");
|
||||
_server.ReadStaticMapping(folder);
|
||||
|
||||
var mappings = _server.Mappings.ToArray();
|
||||
Check.That(mappings).HasSize(1);
|
||||
|
||||
Reference in New Issue
Block a user