Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
Running resharper code formatting
Adding 5.0 settings to solution
  • Loading branch information
loudej committed Mar 14, 2011
1 parent 446c103 commit cada507
Show file tree
Hide file tree
Showing 16 changed files with 336 additions and 167 deletions.
71 changes: 71 additions & 0 deletions Gate.5.0.ReSharper
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<Configuration>
<CodeStyleSettings>
<ExternalPath IsNull="False">
</ExternalPath>
<Sharing>SOLUTION</Sharing>
<CSharp>
<FormatSettings>
<EXPLICIT_PRIVATE_MODIFIER>False</EXPLICIT_PRIVATE_MODIFIER>
<MODIFIERS_ORDER IsNull="False">
<Item>public</Item>
<Item>protected</Item>
<Item>internal</Item>
<Item>private</Item>
<Item>new</Item>
<Item>abstract</Item>
<Item>virtual</Item>
<Item>override</Item>
<Item>sealed</Item>
<Item>static</Item>
<Item>readonly</Item>
<Item>extern</Item>
<Item>unsafe</Item>
<Item>volatile</Item>
</MODIFIERS_ORDER>
</FormatSettings>
<UsingsSettings />
<Naming2>
<EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
<EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
</Naming2>
</CSharp>
<VB>
<FormatSettings />
<ImportsSettings />
<Naming2>
<EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
<EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
</Naming2>
</VB>
<Web>
<Naming2 />
</Web>
<Xaml>
<Naming2 />
</Xaml>
<XML>
<FormatSettings />
</XML>
<GenerateMemberBody />
<Naming2>
<EventHandlerPatternLong>$object$_On$event$</EventHandlerPatternLong>
<EventHandlerPatternShort>$event$Handler</EventHandlerPatternShort>
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
<PredefinedRule Inspect="True" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
<PredefinedRule Inspect="True" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
<PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateInstanceFields" />
<PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Constants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
</Naming2>
</CodeStyleSettings>
</Configuration>
6 changes: 5 additions & 1 deletion Gate.Helpers.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Gate.Helpers.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +18,11 @@
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("5eaec6c6-f0c2-41d0-b723-a1c9a83274c1")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +35,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
72 changes: 39 additions & 33 deletions Gate.Helpers.Tests/RequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,39 @@
using System.Net;
using NUnit.Framework;

namespace Gate.Helpers.Tests {
namespace Gate.Helpers.Tests
{
using BodyDelegate = Func<
// on next
Func<
ArraySegment<byte>, // data
Action, // continuation
bool // continuation was or will be invoked
Func<
ArraySegment<byte>, // data
Action, // continuation
bool // continuation was or will be invoked
>,

// on error
Action<Exception>,

// on complete
Action,

// cancel
Action
// on error
Action<Exception>,
// on complete
Action,
// cancel
Action
>;

// ReSharper disable InconsistentNaming
[TestFixture]
public class RequestTests {
public class RequestTests
{
[Test]
public void Version_property_provide_access_to_environment() {
var env = new Dictionary<string, object> { { "owin.Version", "1.0" } };
public void Version_property_provide_access_to_environment()
{
var env = new Dictionary<string, object> {{"owin.Version", "1.0"}};
var request = new Request(env);
Assert.That(request.Version, Is.EqualTo("1.0"));
}

[Test]
public void Envoronment_access_is_not_buffered_or_cached() {
var env = new Dictionary<string, object> { { "owin.Version", "1.0" } };
public void Envoronment_access_is_not_buffered_or_cached()
{
var env = new Dictionary<string, object> {{"owin.Version", "1.0"}};
var request = new Request(env);
Assert.That(request.Version, Is.EqualTo("1.0"));

Expand All @@ -49,7 +50,8 @@ public void Envoronment_access_is_not_buffered_or_cached() {
}

[Test]
public void All_environment_variables_from_spec_are_available_as_typed_properties() {
public void All_environment_variables_from_spec_are_available_as_typed_properties()
{
//"owin.RequestMethod" A string containing the HTTP request method of the request (e.g., "GET", "POST").
//"owin.RequestUri" A string containing the HTTP request URI of the request. The value must include the query string of the HTTP request URI (e.g., "/path/and?query=string"). The URI must be relative to the application delegate; see Paths.
//"owin.RequestHeaders" An instance of IDictionary<string, string> which represents the HTTP headers present in the request (the request header dictionary); see Headers.
Expand All @@ -62,18 +64,22 @@ public void All_environment_variables_from_spec_are_available_as_typed_propertie

var headers = new Dictionary<string, string>();
BodyDelegate body = (next, error, complete) => () => { };
var env = new Dictionary<string, object> {
{ "owin.RequestMethod", "GET" },
{ "owin.RequestUri", "/foo" },
{ "owin.RequestHeaders", headers },
{ "owin.RequestBody", body },
{ "owin.BaseUri", "/my-app" },
{ "owin.ServerName", "localhost" },
{ "owin.ServerPort", "8080" },
{ "owin.UriScheme", "https" },
{ "owin.RemoteEndPoint", new IPEndPoint(IPAddress.Parse("127.0.0.1") ?? IPAddress.None, 80)},
{ "owin.Version", "1.0" },
};
var env = new Dictionary<string, object>
{
{"owin.RequestMethod", "GET"},
{"owin.RequestUri", "/foo"},
{"owin.RequestHeaders", headers},
{"owin.RequestBody", body},
{"owin.BaseUri", "/my-app"},
{"owin.ServerName", "localhost"},
{"owin.ServerPort", "8080"},
{"owin.UriScheme", "https"},
{
"owin.RemoteEndPoint",
new IPEndPoint(IPAddress.Parse("127.0.0.1") ?? IPAddress.None, 80)
},
{"owin.Version", "1.0"},
};

var request = new Request(env);
Assert.That(request.Method, Is.EqualTo("GET"));
Expand All @@ -88,4 +94,4 @@ public void All_environment_variables_from_spec_are_available_as_typed_propertie
Assert.That(request.Version, Is.EqualTo("1.0"));
}
}
}
}
1 change: 1 addition & 0 deletions Gate.Helpers.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<packages>
<package id="NUnit" version="2.5.9.10348" />
</packages>
6 changes: 5 additions & 1 deletion Gate.Helpers/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Gate.Helpers")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +18,11 @@
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("2e0f13d2-acc5-48c8-a686-161a87f8ba5c")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +35,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit cada507

Please sign in to comment.