Skip to content

Commit

Permalink
improving code quality and routing structure. Renaming some routing s…
Browse files Browse the repository at this point in the history
…trategy code.
  • Loading branch information
mariodivece committed Apr 12, 2016
1 parent 45242c0 commit 4bb911a
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 168 deletions.
4 changes: 2 additions & 2 deletions Unosquare.Labs.EmbedIO.Tests/RegexRoutesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Unosquare.Labs.EmbedIO.Tests
{
[TestFixture]
public class RegexRoutesTest
public class RegExRoutesTest
{
protected WebServer WebServer;
protected TestConsoleLog Logger = new TestConsoleLog();
Expand All @@ -18,7 +18,7 @@ public class RegexRoutesTest
public void Init()
{
WebServer =
new WebServer(Resources.ServerAddress, Logger, RoutingStrategyEnum.Regex)
new WebServer(Resources.ServerAddress, Logger, RoutingStrategy.RegEx)
.WithWebApiController<TestRegexController>();
WebServer.RunAsync();
}
Expand Down
200 changes: 100 additions & 100 deletions Unosquare.Labs.EmbedIO.Tests/Unosquare.Labs.EmbedIO.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,107 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2E100548-08CD-4EFD-AD08-AF584081B098}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Unosquare.Labs.EmbedIO.Tests</RootNamespace>
<AssemblyName>Unosquare.Labs.EmbedIO.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CorsModuleTest.cs" />
<Compile Include="FluentTest.cs" />
<Compile Include="LocalSessionModuleTest.cs" />
<Compile Include="MiddlewareTest.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="RegexRoutesTest.cs" />
<Compile Include="StaticFilesModuleTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestObjects\PeopleRepository.cs" />
<Compile Include="TestObjects\TestConsoleLog.cs" />
<Compile Include="TestObjects\TestController.cs" />
<Compile Include="TestObjects\TestHelper.cs" />
<Compile Include="TestObjects\TestMiddleware.cs" />
<Compile Include="TestObjects\TestRegexController.cs" />
<Compile Include="TestObjects\TestWebModule.cs" />
<Compile Include="TestObjects\TestWebSocket.cs" />
<Compile Include="WebApiModuleTest.cs" />
<Compile Include="WebServerCultureTest.cs" />
<Compile Include="WebServerTest.cs" />
<Compile Include="WebSocketsModuleTest.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Unosquare.Labs.EmbedIO\Unosquare.Labs.EmbedIO.csproj">
<Project>{7d7c29b4-9493-4ebd-8f20-6fac1e7161ee}</Project>
<Name>Unosquare.Labs.EmbedIO</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="html\index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2E100548-08CD-4EFD-AD08-AF584081B098}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Unosquare.Labs.EmbedIO.Tests</RootNamespace>
<AssemblyName>Unosquare.Labs.EmbedIO.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CorsModuleTest.cs" />
<Compile Include="FluentTest.cs" />
<Compile Include="LocalSessionModuleTest.cs" />
<Compile Include="MiddlewareTest.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="RegExRoutesTest.cs" />
<Compile Include="StaticFilesModuleTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestObjects\PeopleRepository.cs" />
<Compile Include="TestObjects\TestConsoleLog.cs" />
<Compile Include="TestObjects\TestController.cs" />
<Compile Include="TestObjects\TestHelper.cs" />
<Compile Include="TestObjects\TestMiddleware.cs" />
<Compile Include="TestObjects\TestRegexController.cs" />
<Compile Include="TestObjects\TestWebModule.cs" />
<Compile Include="TestObjects\TestWebSocket.cs" />
<Compile Include="WebApiModuleTest.cs" />
<Compile Include="WebServerCultureTest.cs" />
<Compile Include="WebServerTest.cs" />
<Compile Include="WebSocketsModuleTest.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Unosquare.Labs.EmbedIO\Unosquare.Labs.EmbedIO.csproj">
<Project>{7d7c29b4-9493-4ebd-8f20-6fac1e7161ee}</Project>
<Name>Unosquare.Labs.EmbedIO</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="html\index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
8 changes: 5 additions & 3 deletions Unosquare.Labs.EmbedIO/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,11 @@ public static class Constants
}

/// <summary>
/// Defines the routing strategy enumeration
/// Defines the routing strategy for URL matching
/// This is especially useful for REST service implementations
/// in the WebApi module.
/// </summary>
public enum RoutingStrategyEnum
public enum RoutingStrategy
{
/// <summary>
/// The wildcard strategy, default one
Expand All @@ -734,6 +736,6 @@ public enum RoutingStrategyEnum
/// <summary>
/// The Regex strategy
/// </summary>
Regex
RegEx
}
}
Loading

0 comments on commit 4bb911a

Please sign in to comment.