Skip to content

Commit

Permalink
Fix #110
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Mar 20, 2018
1 parent a4a9f2c commit a3c853b
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 125 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 1.0.3.11 (20 March 2018)

- [#110](https://github.com/WireMock-Net/WireMock.Net/issues/110) - Fix: remove `Func[]` from MappingModel

Commits: a4a9f2c862...a4a9f2c862


# 1.0.3.10 (17 March 2018)

- [#109](https://github.com/WireMock-Net/WireMock.Net/issues/109) - Issue: When proxying, MimeType is wrong for StringContent
Expand Down
2 changes: 1 addition & 1 deletion GitReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
https://github.com/GitTools/GitReleaseNotes

GitReleaseNotes.exe . /OutputFile CHANGELOG.md /Version 1.0.3.10
GitReleaseNotes.exe . /OutputFile CHANGELOG.md /Version 1.0.3.11

GitReleaseNotes.exe . /OutputFile CHANGELOG.md /allTags
2 changes: 1 addition & 1 deletion src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Lightweight StandAlone Http Mocking Server for .Net.</Description>
<AssemblyTitle>WireMock.Net.StandAlone</AssemblyTitle>
<Version>1.0.3.10</Version>
<Version>1.0.3.11</Version>
<Authors>Stef Heyenrath</Authors>
<TargetFrameworks>net452;net46;netstandard1.3;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
25 changes: 8 additions & 17 deletions src/WireMock.Net/Admin/Mappings/BodyModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,16 @@ public class BodyModel
/// <summary>
/// Gets or sets the matcher.
/// </summary>
/// <value>
/// The matcher.
/// </value>
public MatcherModel Matcher { get; set; }

/// <summary>
/// Gets or sets the function.
/// </summary>
/// <value>
/// The function.
/// </value>
public string Func { get; set; }
///// <summary>
///// Gets or sets the function.
///// </summary>
//public string Func { get; set; }

/// <summary>
/// Gets or sets the data function.
/// </summary>
/// <value>
/// The data function.
/// </value>
public string DataFunc { get; set; }
///// <summary>
///// Gets or sets the data function.
///// </summary>
//public string DataFunc { get; set; }
}
}
14 changes: 4 additions & 10 deletions src/WireMock.Net/Admin/Mappings/ClientIPModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ public class ClientIPModel
/// <summary>
/// Gets or sets the matchers.
/// </summary>
/// <value>
/// The matchers.
/// </value>
public MatcherModel[] Matchers { get; set; }

/// <summary>
/// Gets or sets the functions.
/// </summary>
/// <value>
/// The functions.
/// </value>
public string[] Funcs { get; set; }
///// <summary>
///// Gets or sets the functions.
///// </summary>
//public string[] Funcs { get; set; }
}
}
17 changes: 4 additions & 13 deletions src/WireMock.Net/Admin/Mappings/CookieModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,16 @@ public class CookieModel
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get; set; }

/// <summary>
/// Gets or sets the matchers.
/// </summary>
/// <value>
/// The matchers.
/// </value>
public IList<MatcherModel> Matchers { get; set; }

/// <summary>
/// Gets or sets the functions.
/// </summary>
/// <value>
/// The functions.
/// </value>
public string[] Funcs { get; set; }
///// <summary>
///// Gets or sets the functions.
///// </summary>
//public string[] Funcs { get; set; }
}
}
17 changes: 4 additions & 13 deletions src/WireMock.Net/Admin/Mappings/HeaderModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,16 @@ public class HeaderModel
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get; set; }

/// <summary>
/// Gets or sets the matchers.
/// </summary>
/// <value>
/// The matchers.
/// </value>
public IList<MatcherModel> Matchers { get; set; }

/// <summary>
/// Gets or sets the functions.
/// </summary>
/// <value>
/// The functions.
/// </value>
public string[] Funcs { get; set; }
///// <summary>
///// Gets or sets the functions.
///// </summary>
//public string[] Funcs { get; set; }
}
}
17 changes: 4 additions & 13 deletions src/WireMock.Net/Admin/Mappings/ParamModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,16 @@ public class ParamModel
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get; set; }

/// <summary>
/// Gets or sets the values.
/// </summary>
/// <value>
/// The values.
/// </value>
public IList<string> Values { get; set; }

/// <summary>
/// Gets or sets the functions.
/// </summary>
/// <value>
/// The functions.
/// </value>
public string[] Funcs { get; set; }
///// <summary>
///// Gets or sets the functions.
///// </summary>
//public string[] Funcs { get; set; }
}
}
14 changes: 4 additions & 10 deletions src/WireMock.Net/Admin/Mappings/PathModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ public class PathModel
/// <summary>
/// Gets or sets the matchers.
/// </summary>
/// <value>
/// The matchers.
/// </value>
public MatcherModel[] Matchers { get; set; }

/// <summary>
/// Gets or sets the functions.
/// </summary>
/// <value>
/// The functions.
/// </value>
public string[] Funcs { get; set; }
///// <summary>
///// Gets or sets the functions.
///// </summary>
//public string[] Funcs { get; set; }
}
}
21 changes: 0 additions & 21 deletions src/WireMock.Net/Admin/Mappings/RequestModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,16 @@ public class RequestModel
/// <summary>
/// Gets or sets the ClientIP. (Can be a string or a ClientIPModel)
/// </summary>
/// <value>
/// The ClientIP.
/// </value>
public object ClientIP { get; set; }

/// <summary>
/// Gets or sets the Path. (Can be a string or a PathModel)
/// </summary>
/// <value>
/// The Path.
/// </value>
public object Path { get; set; }

/// <summary>
/// Gets or sets the Url. (Can be a string or a UrlModel)
/// </summary>
/// <value>
/// The URL.
/// </value>
public object Url { get; set; }

/// <summary>
Expand All @@ -39,33 +30,21 @@ public class RequestModel
/// <summary>
/// Gets or sets the Headers.
/// </summary>
/// <value>
/// The Headers.
/// </value>
public IList<HeaderModel> Headers { get; set; }

/// <summary>
/// Gets or sets the Cookies.
/// </summary>
/// <value>
/// The Cookies.
/// </value>
public IList<CookieModel> Cookies { get; set; }

/// <summary>
/// Gets or sets the Params.
/// </summary>
/// <value>
/// The Headers.
/// </value>
public IList<ParamModel> Params { get; set; }

/// <summary>
/// Gets or sets the body.
/// </summary>
/// <value>
/// The body.
/// </value>
public BodyModel Body { get; set; }
}
}
14 changes: 4 additions & 10 deletions src/WireMock.Net/Admin/Mappings/UrlModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ public class UrlModel
/// <summary>
/// Gets or sets the matchers.
/// </summary>
/// <value>
/// The matchers.
/// </value>
public MatcherModel[] Matchers { get; set; }

/// <summary>
/// Gets or sets the functions.
/// </summary>
/// <value>
/// The functions.
/// </value>
public string[] Funcs { get; set; }
///// <summary>
///// Gets or sets the functions.
///// </summary>
//public string[] Funcs { get; set; }
}
}
30 changes: 15 additions & 15 deletions src/WireMock.Net/Serialization/MappingConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,50 +38,50 @@ public static MappingModel ToMappingModel(Mapping mapping)
{
ClientIP = clientIPMatchers != null && clientIPMatchers.Any() ? new ClientIPModel
{
Matchers = MatcherMapper.Map(clientIPMatchers.Where(m => m.Matchers != null).SelectMany(m => m.Matchers)),
Funcs = Map(clientIPMatchers.Where(m => m.Funcs != null).SelectMany(m => m.Funcs))
Matchers = MatcherMapper.Map(clientIPMatchers.Where(m => m.Matchers != null).SelectMany(m => m.Matchers))
//Funcs = Map(clientIPMatchers.Where(m => m.Funcs != null).SelectMany(m => m.Funcs))
} : null,

Path = pathMatchers != null && pathMatchers.Any() ? new PathModel
{
Matchers = MatcherMapper.Map(pathMatchers.Where(m => m.Matchers != null).SelectMany(m => m.Matchers)),
Funcs = Map(pathMatchers.Where(m => m.Funcs != null).SelectMany(m => m.Funcs))
Matchers = MatcherMapper.Map(pathMatchers.Where(m => m.Matchers != null).SelectMany(m => m.Matchers))
//Funcs = Map(pathMatchers.Where(m => m.Funcs != null).SelectMany(m => m.Funcs))
} : null,

Url = urlMatchers != null && urlMatchers.Any() ? new UrlModel
{
Matchers = MatcherMapper.Map(urlMatchers.Where(m => m.Matchers != null).SelectMany(m => m.Matchers)),
Funcs = Map(urlMatchers.Where(m => m.Funcs != null).SelectMany(m => m.Funcs))
Matchers = MatcherMapper.Map(urlMatchers.Where(m => m.Matchers != null).SelectMany(m => m.Matchers))
//Funcs = Map(urlMatchers.Where(m => m.Funcs != null).SelectMany(m => m.Funcs))
} : null,

Methods = methodMatcher?.Methods,

Headers = headerMatchers != null && headerMatchers.Any() ? headerMatchers.Select(hm => new HeaderModel
{
Name = hm.Name,
Matchers = MatcherMapper.Map(hm.Matchers),
Funcs = Map(hm.Funcs)
Matchers = MatcherMapper.Map(hm.Matchers)
//Funcs = Map(hm.Funcs)
}).ToList() : null,

Cookies = cookieMatchers != null && cookieMatchers.Any() ? cookieMatchers.Select(cm => new CookieModel
{
Name = cm.Name,
Matchers = MatcherMapper.Map(cm.Matchers),
Funcs = Map(cm.Funcs)
Matchers = MatcherMapper.Map(cm.Matchers)
//Funcs = Map(cm.Funcs)
}).ToList() : null,

Params = paramsMatchers != null && paramsMatchers.Any() ? paramsMatchers.Select(pm => new ParamModel
{
Name = pm.Key,
Values = pm.Values?.ToList(),
Funcs = Map(pm.Funcs)
Values = pm.Values?.ToList()
//Funcs = Map(pm.Funcs)
}).ToList() : null,

Body = methodMatcher?.Methods != null && methodMatcher.Methods.Any(m => m == "get") ? null : new BodyModel
{
Matcher = bodyMatcher != null ? MatcherMapper.Map(bodyMatcher.Matcher) : null,
Func = bodyMatcher != null ? Map(bodyMatcher.Func) : null,
DataFunc = bodyMatcher != null ? Map(bodyMatcher.DataFunc) : null
Matcher = bodyMatcher != null ? MatcherMapper.Map(bodyMatcher.Matcher) : null
//Func = bodyMatcher != null ? Map(bodyMatcher.Func) : null,
//DataFunc = bodyMatcher != null ? Map(bodyMatcher.DataFunc) : null
}
},
Response = new ResponseModel
Expand Down
2 changes: 1 addition & 1 deletion src/WireMock.Net/WireMock.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape.</Description>
<AssemblyTitle>WireMock.Net</AssemblyTitle>
<Version>1.0.3.10</Version>
<Version>1.0.3.11</Version>
<Authors>Stef Heyenrath</Authors>
<TargetFrameworks>net452;net46;netstandard1.3;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down

0 comments on commit a3c853b

Please sign in to comment.