From a3c853b4adc0c9f36c9ffaa74ef7efda04455f5b Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Tue, 20 Mar 2018 21:06:58 +0100 Subject: [PATCH] Fix #110 --- CHANGELOG.md | 7 +++++ GitReleaseNotes.txt | 2 +- .../WireMock.Net.StandAlone.csproj | 2 +- src/WireMock.Net/Admin/Mappings/BodyModel.cs | 25 +++++----------- .../Admin/Mappings/ClientIPModel.cs | 14 +++------ .../Admin/Mappings/CookieModel.cs | 17 +++-------- .../Admin/Mappings/HeaderModel.cs | 17 +++-------- src/WireMock.Net/Admin/Mappings/ParamModel.cs | 17 +++-------- src/WireMock.Net/Admin/Mappings/PathModel.cs | 14 +++------ .../Admin/Mappings/RequestModel.cs | 21 ------------- src/WireMock.Net/Admin/Mappings/UrlModel.cs | 14 +++------ .../Serialization/MappingConverter.cs | 30 +++++++++---------- src/WireMock.Net/WireMock.Net.csproj | 2 +- 13 files changed, 57 insertions(+), 125 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a9d0e9a0..1f1c448ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/GitReleaseNotes.txt b/GitReleaseNotes.txt index ac093d61f..1375b5c45 100644 --- a/GitReleaseNotes.txt +++ b/GitReleaseNotes.txt @@ -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 diff --git a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj index ede657ca8..18266ed9c 100644 --- a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj +++ b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj @@ -3,7 +3,7 @@ Lightweight StandAlone Http Mocking Server for .Net. WireMock.Net.StandAlone - 1.0.3.10 + 1.0.3.11 Stef Heyenrath net452;net46;netstandard1.3;netstandard2.0 true diff --git a/src/WireMock.Net/Admin/Mappings/BodyModel.cs b/src/WireMock.Net/Admin/Mappings/BodyModel.cs index c31306a87..322204092 100644 --- a/src/WireMock.Net/Admin/Mappings/BodyModel.cs +++ b/src/WireMock.Net/Admin/Mappings/BodyModel.cs @@ -8,25 +8,16 @@ public class BodyModel /// /// Gets or sets the matcher. /// - /// - /// The matcher. - /// public MatcherModel Matcher { get; set; } - /// - /// Gets or sets the function. - /// - /// - /// The function. - /// - public string Func { get; set; } + ///// + ///// Gets or sets the function. + ///// + //public string Func { get; set; } - /// - /// Gets or sets the data function. - /// - /// - /// The data function. - /// - public string DataFunc { get; set; } + ///// + ///// Gets or sets the data function. + ///// + //public string DataFunc { get; set; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Admin/Mappings/ClientIPModel.cs b/src/WireMock.Net/Admin/Mappings/ClientIPModel.cs index 4a04448a1..aad9c9dfc 100644 --- a/src/WireMock.Net/Admin/Mappings/ClientIPModel.cs +++ b/src/WireMock.Net/Admin/Mappings/ClientIPModel.cs @@ -8,17 +8,11 @@ public class ClientIPModel /// /// Gets or sets the matchers. /// - /// - /// The matchers. - /// public MatcherModel[] Matchers { get; set; } - /// - /// Gets or sets the functions. - /// - /// - /// The functions. - /// - public string[] Funcs { get; set; } + ///// + ///// Gets or sets the functions. + ///// + //public string[] Funcs { get; set; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Admin/Mappings/CookieModel.cs b/src/WireMock.Net/Admin/Mappings/CookieModel.cs index 3a54f741e..03a4561fc 100644 --- a/src/WireMock.Net/Admin/Mappings/CookieModel.cs +++ b/src/WireMock.Net/Admin/Mappings/CookieModel.cs @@ -10,25 +10,16 @@ public class CookieModel /// /// Gets or sets the name. /// - /// - /// The name. - /// public string Name { get; set; } /// /// Gets or sets the matchers. /// - /// - /// The matchers. - /// public IList Matchers { get; set; } - /// - /// Gets or sets the functions. - /// - /// - /// The functions. - /// - public string[] Funcs { get; set; } + ///// + ///// Gets or sets the functions. + ///// + //public string[] Funcs { get; set; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Admin/Mappings/HeaderModel.cs b/src/WireMock.Net/Admin/Mappings/HeaderModel.cs index 84eeed160..abd501967 100644 --- a/src/WireMock.Net/Admin/Mappings/HeaderModel.cs +++ b/src/WireMock.Net/Admin/Mappings/HeaderModel.cs @@ -10,25 +10,16 @@ public class HeaderModel /// /// Gets or sets the name. /// - /// - /// The name. - /// public string Name { get; set; } /// /// Gets or sets the matchers. /// - /// - /// The matchers. - /// public IList Matchers { get; set; } - /// - /// Gets or sets the functions. - /// - /// - /// The functions. - /// - public string[] Funcs { get; set; } + ///// + ///// Gets or sets the functions. + ///// + //public string[] Funcs { get; set; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Admin/Mappings/ParamModel.cs b/src/WireMock.Net/Admin/Mappings/ParamModel.cs index 0135de2db..d118c7345 100644 --- a/src/WireMock.Net/Admin/Mappings/ParamModel.cs +++ b/src/WireMock.Net/Admin/Mappings/ParamModel.cs @@ -10,25 +10,16 @@ public class ParamModel /// /// Gets or sets the name. /// - /// - /// The name. - /// public string Name { get; set; } /// /// Gets or sets the values. /// - /// - /// The values. - /// public IList Values { get; set; } - /// - /// Gets or sets the functions. - /// - /// - /// The functions. - /// - public string[] Funcs { get; set; } + ///// + ///// Gets or sets the functions. + ///// + //public string[] Funcs { get; set; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Admin/Mappings/PathModel.cs b/src/WireMock.Net/Admin/Mappings/PathModel.cs index 233a5f444..ecd42a3c5 100644 --- a/src/WireMock.Net/Admin/Mappings/PathModel.cs +++ b/src/WireMock.Net/Admin/Mappings/PathModel.cs @@ -8,17 +8,11 @@ public class PathModel /// /// Gets or sets the matchers. /// - /// - /// The matchers. - /// public MatcherModel[] Matchers { get; set; } - /// - /// Gets or sets the functions. - /// - /// - /// The functions. - /// - public string[] Funcs { get; set; } + ///// + ///// Gets or sets the functions. + ///// + //public string[] Funcs { get; set; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Admin/Mappings/RequestModel.cs b/src/WireMock.Net/Admin/Mappings/RequestModel.cs index 84c8fb1c7..5097a9308 100644 --- a/src/WireMock.Net/Admin/Mappings/RequestModel.cs +++ b/src/WireMock.Net/Admin/Mappings/RequestModel.cs @@ -10,25 +10,16 @@ public class RequestModel /// /// Gets or sets the ClientIP. (Can be a string or a ClientIPModel) /// - /// - /// The ClientIP. - /// public object ClientIP { get; set; } /// /// Gets or sets the Path. (Can be a string or a PathModel) /// - /// - /// The Path. - /// public object Path { get; set; } /// /// Gets or sets the Url. (Can be a string or a UrlModel) /// - /// - /// The URL. - /// public object Url { get; set; } /// @@ -39,33 +30,21 @@ public class RequestModel /// /// Gets or sets the Headers. /// - /// - /// The Headers. - /// public IList Headers { get; set; } /// /// Gets or sets the Cookies. /// - /// - /// The Cookies. - /// public IList Cookies { get; set; } /// /// Gets or sets the Params. /// - /// - /// The Headers. - /// public IList Params { get; set; } /// /// Gets or sets the body. /// - /// - /// The body. - /// public BodyModel Body { get; set; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Admin/Mappings/UrlModel.cs b/src/WireMock.Net/Admin/Mappings/UrlModel.cs index 0f5ce3af2..68ac6d63c 100644 --- a/src/WireMock.Net/Admin/Mappings/UrlModel.cs +++ b/src/WireMock.Net/Admin/Mappings/UrlModel.cs @@ -8,17 +8,11 @@ public class UrlModel /// /// Gets or sets the matchers. /// - /// - /// The matchers. - /// public MatcherModel[] Matchers { get; set; } - /// - /// Gets or sets the functions. - /// - /// - /// The functions. - /// - public string[] Funcs { get; set; } + ///// + ///// Gets or sets the functions. + ///// + //public string[] Funcs { get; set; } } } diff --git a/src/WireMock.Net/Serialization/MappingConverter.cs b/src/WireMock.Net/Serialization/MappingConverter.cs index 088ee84ea..ab9c399db 100644 --- a/src/WireMock.Net/Serialization/MappingConverter.cs +++ b/src/WireMock.Net/Serialization/MappingConverter.cs @@ -38,20 +38,20 @@ 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, @@ -59,29 +59,29 @@ public static MappingModel ToMappingModel(Mapping mapping) 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 diff --git a/src/WireMock.Net/WireMock.Net.csproj b/src/WireMock.Net/WireMock.Net.csproj index 07f264653..efdbef181 100644 --- a/src/WireMock.Net/WireMock.Net.csproj +++ b/src/WireMock.Net/WireMock.Net.csproj @@ -3,7 +3,7 @@ Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape. WireMock.Net - 1.0.3.10 + 1.0.3.11 Stef Heyenrath net452;net46;netstandard1.3;netstandard2.0 true