Skip to content

Commit

Permalink
Merge pull request #72 from jchannon/danielcrenna/master
Browse files Browse the repository at this point in the history
Resolves #64 comments - previous PR fork deleted
  • Loading branch information
darrelmiller authored Nov 6, 2021
2 parents 2696df1 + b1a5f3d commit 5441893
Show file tree
Hide file tree
Showing 32 changed files with 165 additions and 1,057 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ artifacts
*.nupkg
publish-tavis*.ps1
project.lock.json
.vs/
.vs/
.idea
117 changes: 31 additions & 86 deletions UriTemplates.sln
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio 15
VisualStudioVersion = 15.0.28307.489
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0C994FD2-43CE-4412-BCCD-628DBD8130DF}"
ProjectSection(SolutionItems) = preProject
License.txt = License.txt
Readme.md = Readme.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates", "src\UriTemplates\UriTemplates.csproj", "{F571E020-AB02-4284-BE11-033D6E92EB66}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplateTests", "src\UriTemplateTests\UriTemplateTests.csproj", "{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplatesPCL", "src\UriTemplatesPCL\UriTemplatesPCL.csproj", "{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplatesPCLTests", "src\UriTemplatesPCLTests\UriTemplatesPCLTests.csproj", "{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates.net45", "src\UriTemplates.net45\UriTemplates.net45.csproj", "{9AE8407F-07FB-4536-9EE1-0A64831A42C3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{718037C6-0F82-456A-B7EB-531694D035B4}"
ProjectSection(SolutionItems) = preProject
build\Build.proj = build\Build.proj
ReleaseNotes.md = ReleaseNotes.md
build\Tavis.UriTemplates.nuspec = build\Tavis.UriTemplates.nuspec
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates.net40", "src\UriTemplates.net40\UriTemplates.net40.csproj", "{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UriTemplates", "src\UriTemplates\UriTemplates.csproj", "{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UriTemplates.profile92", "src\UriTemplates.profile92\UriTemplates.profile92.csproj", "{147131F4-08E6-401E-BB27-FFB9754A9682}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UriTemplateTests", "src\UriTemplateTests\UriTemplateTests.csproj", "{2D43074E-C8E2-4D1D-B64D-7A267908840B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -40,78 +28,35 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Debug|x86.ActiveCfg = Debug|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Any CPU.Build.0 = Release|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F571E020-AB02-4284-BE11-033D6E92EB66}.Release|x86.ActiveCfg = Release|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Debug|x86.ActiveCfg = Debug|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Any CPU.Build.0 = Release|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5B4A94DF-2CBB-41BF-AAB3-F7991F0C6A4B}.Release|x86.ActiveCfg = Release|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Debug|x86.ActiveCfg = Debug|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Any CPU.Build.0 = Release|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F12EB113-49BE-4A8E-BEFB-D04D7C0C2DEF}.Release|x86.ActiveCfg = Release|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Debug|x86.ActiveCfg = Debug|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Any CPU.Build.0 = Release|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{ADBEFEDC-53B9-4835-A546-EBD3B3F9E939}.Release|x86.ActiveCfg = Release|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Debug|x86.ActiveCfg = Debug|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Any CPU.Build.0 = Release|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9AE8407F-07FB-4536-9EE1-0A64831A42C3}.Release|x86.ActiveCfg = Release|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Debug|x86.ActiveCfg = Debug|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Any CPU.Build.0 = Release|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F8ED5782-BD7C-46C4-B2DA-42D9BC49C748}.Release|x86.ActiveCfg = Release|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Any CPU.Build.0 = Debug|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Debug|x86.ActiveCfg = Debug|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Any CPU.ActiveCfg = Release|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Any CPU.Build.0 = Release|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{147131F4-08E6-401E-BB27-FFB9754A9682}.Release|x86.ActiveCfg = Release|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Debug|x86.ActiveCfg = Debug|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Debug|x86.Build.0 = Debug|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Release|Any CPU.Build.0 = Release|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Release|x86.ActiveCfg = Release|Any CPU
{F60E3FBC-22FE-43A7-A46B-93C30B74B72A}.Release|x86.Build.0 = Release|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Debug|x86.ActiveCfg = Debug|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Debug|x86.Build.0 = Debug|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Release|Any CPU.Build.0 = Release|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Release|x86.ActiveCfg = Release|Any CPU
{2D43074E-C8E2-4D1D-B64D-7A267908840B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C814C2F5-05C7-4FAD-A250-2EB1FC0364A0}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set config=%1
if "%config%" == "" (
set config=debug
)

md artifacts
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild build\build.proj /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
dotnet build --configuration %config% --verbosity normal /m /v:M /fl /flp:LogFile=msbuild.log; /nr:false
dotnet pack --no-build --configuration %config% --output %cd%\artifacts
42 changes: 0 additions & 42 deletions build/Build.proj

This file was deleted.

26 changes: 0 additions & 26 deletions build/Tavis.UriTemplates.nuspec

This file was deleted.

36 changes: 0 additions & 36 deletions src/UriTemplateTests/Properties/AssemblyInfo.cs

This file was deleted.

19 changes: 13 additions & 6 deletions src/UriTemplateTests/SpecTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace UriTemplateTests
public class UriTemplateTests2
{

[Theory, MemberData("SpecSamples")]
[Theory, MemberData(nameof(SpecSamples))]
public void SpecSamplesTest(string template, string[] results, TestSet.TestCase testCase)
{
var uriTemplate = new UriTemplate(template);
Expand All @@ -25,11 +25,11 @@ public void SpecSamplesTest(string template, string[] results, TestSet.TestCase
string result = null;
result = uriTemplate.Resolve();

Assert.True(results.Contains(result));
Assert.Contains(results, x => x == result);
}


[Theory, MemberData("ExtendedSamples")]
[Theory, MemberData(nameof(ExtendedSamples))]
public void ExtendedSamplesTest(string template, string[] results, TestSet.TestCase testCase)
{
var uriTemplate = new UriTemplate(template);
Expand Down Expand Up @@ -58,13 +58,13 @@ public void ExtendedSamplesTest(string template, string[] results, TestSet.TestC
}
else
{
Assert.True(results.Contains(result));
Assert.Contains(results, x => x == result);
}

}


// Disabled for the moment. [Theory, PropertyData("FailureSamples")]
[Theory(Skip = "Disabled for the moment."), MemberData(nameof(FailureSamples))]
public void FailureSamplesTest(string template, string[] results, TestSet.TestCase testCase)
{
var uriTemplate = new UriTemplate(template);
Expand All @@ -87,7 +87,14 @@ public void FailureSamplesTest(string template, string[] results, TestSet.TestCa
aex = ex;
}

Assert.NotNull(aex);
if (results[0] == "False")
{
Assert.NotNull(aex);
}
else
{
Assert.Contains(results, x => x == result);
}


}
Expand Down
11 changes: 5 additions & 6 deletions src/UriTemplateTests/UriTemplateTableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void FindTemplatesInGamesApi(string url, string key)
]
public void FindTemplatesWithQueryStrings(string url, string key)
{
var table = new UriTemplateTable(); // More restrictive templates should have priority over less restrictuve ones
var table = new UriTemplateTable(); // More restrictive templates should have priority over less restrictive ones
table.Add("fooxy3", new UriTemplate("/foo?x={x}&y={y}"));
table.Add("fooxy2", new UriTemplate("/foo?x={x}{&y}"));
table.Add("fooxy4", new UriTemplate("/foo?x={x}{&z}"));
Expand All @@ -111,7 +111,7 @@ public void FindTemplatesWithQueryStrings(string url, string key)
[Fact]
public void FindTemplatesWithArrayQueryParameters()
{
var table = new UriTemplateTable(); // More restrictive templates should have priority over less restrictuve ones
var table = new UriTemplateTable(); // More restrictive templates should have priority over less restrictive ones
table.Add("fooxy3", new UriTemplate("/foo?x={x}&y={y}"));
table.Add("fooxy2", new UriTemplate("/foo?x={x}{&y}"));
table.Add("fooxy4", new UriTemplate("/foo?x={x}{&z}"));
Expand All @@ -127,15 +127,14 @@ public void FindTemplatesWithArrayQueryParameters()


[Fact]
public void MatchTemplateWithDifferentOrderOfParameters()
public void MatchTemplateWithDifferentOrderOfQueryStringParameters()
{
var table = new UriTemplateTable(); // More restrictive templates should have priority over less restrictuve ones
var table = new UriTemplateTable(); // More restrictive templates should have priority over less restrictive ones
table.Add("fooxy3", new UriTemplate("/foo?x={x}&y={y}"));

var result = table.Match(new Uri("/foo?y=a&x=b", UriKind.RelativeOrAbsolute));
var result = table.Match(new Uri("/foo?y=a&x=b", UriKind.RelativeOrAbsolute), QueryStringParameterOrder.Any);

Assert.Equal("fooxy3", result.Key);

}

}
Expand Down
Loading

0 comments on commit 5441893

Please sign in to comment.