Skip to content

Commit

Permalink
add notes
Browse files Browse the repository at this point in the history
add slides
fixes
  • Loading branch information
unknown committed Apr 26, 2013
1 parent 7f6a95c commit 83aabea
Show file tree
Hide file tree
Showing 18 changed files with 16,683 additions and 4 deletions.
Binary file added CodeCamp2013.ppt
Binary file not shown.
1 change: 1 addition & 0 deletions OrdersDemo/Models/MyRegistrationValidator.cs
Expand Up @@ -21,6 +21,7 @@ public MyRegistrationValidator()
{
RuleFor(x => x.Password).NotEmpty();
RuleFor(x => x.UserName).NotEmpty().When(x => x.Email.IsNullOrEmpty());
RuleFor(x => x.UserName).Length(3, 35);
RuleFor(x => x.UserName)
.Must(x => UserAuthRepo.GetUserAuthByUserName(x) == null)
.WithErrorCode("AlreadyExists")
Expand Down
4 changes: 2 additions & 2 deletions OrdersDemo/Views/Home/Register.cshtml
Expand Up @@ -14,7 +14,7 @@ This is only for Demo purposes and the data will likely be purged often.
</div>
<form id="RegistrationForm" class="form-stacked fade-when-loading">
<div class="clearfix">
<input class="input-medium" name="email" type="text" placeholder="UserName" ng-model="userName" />
<input class="input-medium" name="email" type="text" placeholder="UserName" ng-model="userName" /> *minimum 3 characters
</div>
<div class="clearfix">
<input class="input-medium" name="password" type="password" placeholder="Password" ng-model="password" />
Expand All @@ -25,6 +25,6 @@ This is only for Demo purposes and the data will likely be purged often.
</div>
</form>
<p>&nbsp;</p>
<div id="RegistrationSuccess" class="hidden">Success Start <a href="/Fulfillments">Fulfilling Now!</a></div>
<div id="RegistrationSuccess" class="hidden">Success Start <a href="/Fulfillment">Fulfilling Now!</a></div>
</div>
</div>
4 changes: 2 additions & 2 deletions OrdersDemo/Web.config
Expand Up @@ -13,8 +13,8 @@
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="redisUrl" value="aFS7Jqi1xPV3tEff5WnB@nidoking.ec2.myredis.com:7558"/>
<!--<add key="redisUrl" value="localhost:6379" />-->
<!--<add key="redisUrl" value="aFS7Jqi1xPV3tEff5WnB@nidoking.ec2.myredis.com:7558"/>-->
<add key="redisUrl" value="localhost:6379" />
</appSettings>
<!-- Required for MONO -->
<system.web>
Expand Down
9 changes: 9 additions & 0 deletions ServiceStackWinForm/ServiceStackWinForm.csproj
Expand Up @@ -35,6 +35,12 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks">
<HintPath>..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="ServiceStack">
<HintPath>..\lib\ServiceStack.dll</HintPath>
</Reference>
Expand All @@ -52,6 +58,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -72,6 +79,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SomeTests.cs" />
<EmbeddedResource Include="Main.resx">
<DependentUpon>Main.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -86,6 +94,7 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
69 changes: 69 additions & 0 deletions ServiceStackWinForm/SomeTests.cs
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Routing;
using NUnit.Framework;
using Rhino.Mocks;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface;
using ServiceStack.WebHost.Endpoints.Extensions;

namespace ServiceStackWinForm
{
[TestFixture]
public class Tester
{
[Test]
public void testsomethign()
{
var mockedRequestContext = MockRepository.GenerateMock<IRequestContext>();
var mockedHttpRequest = MockRepository.GenerateMock<IHttpRequest>();
var mockedOriginalRequest = MockRepository.GenerateMock<HttpRequestBase>();
var mockedOriginalRequestContext = MockRepository.GenerateMock<RequestContext>();

mockedOriginalRequest.Stub(x => x.RequestContext).Return(mockedOriginalRequestContext);
mockedHttpRequest.Stub(x => x.OriginalRequest).Return(mockedOriginalRequest);

mockedRequestContext.Stub(x => x.Get<IHttpRequest>()).Return(mockedHttpRequest);
var service = new ServiceTests()
{
RequestContext = mockedRequestContext
};

service.Delete(new DeleteRequest());
}
}

public class DeleteRequest
{
}

public class ServiceTests : Service
{
[RequireFormsAuthentication]
public object Delete(DeleteRequest request)
{
var originalRequest = (HttpRequestBase) Request.OriginalRequest;
var identity = originalRequest.RequestContext.HttpContext.User.Identity;
return null;
//return othercode(identity);
}
}

public class RequireFormsAuthenticationAttribute : RequestFilterAttribute
{
public override void Execute(IHttpRequest req, IHttpResponse res, object requestDto)
{
var originalRequest = (HttpRequest)req.OriginalRequest;
var identity = originalRequest.RequestContext.HttpContext.User.Identity;
if (!identity.IsAuthenticated)
{
res.StatusCode = (int)HttpStatusCode.Forbidden;
res.EndServiceStackRequest(skipHeaders: true);
}
}
}
}
5 changes: 5 additions & 0 deletions ServiceStackWinForm/packages.config
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.2" targetFramework="net40" />
<package id="RhinoMocks" version="3.6.1" targetFramework="net40" />
</packages>
5 changes: 5 additions & 0 deletions TalkNotes.txt
@@ -0,0 +1,5 @@
-clear redis
--redis-cli -h ahost -p aport -a password

-ALWAYS HAVE REDIS RUNNING - CHANGE TO LOCALHOST

Binary file added packages/NUnit.2.6.2/NUnit.2.6.2.nupkg
Binary file not shown.
30 changes: 30 additions & 0 deletions packages/NUnit.2.6.2/NUnit.2.6.2.nuspec
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>NUnit</id>
<version>2.6.2</version>
<title>NUnit</title>
<authors>Charlie Poole</authors>
<owners>Charlie Poole</owners>
<licenseUrl>http://nunit.org/nuget/license.html</licenseUrl>
<projectUrl>http://nunit.org/</projectUrl>
<iconUrl>http://nunit.org/nuget/nunit_32x32.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. A number of runners, both from the NUnit project and by third parties, are able to execute NUnit tests.

Version 2.6 is the seventh major release of this well-known and well-tested programming tool.

This package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner.</description>
<summary>NUnit is a unit-testing framework for all .Net languages with a strong TDD focus.</summary>
<releaseNotes>Version 2.6 is the seventh major release of NUnit.

Unlike earlier versions, this package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner.

The nunit.mocks assembly is now provided by the NUnit.Mocks package. The pnunit.framework assembly is provided by the pNUnit package.</releaseNotes>
<language>en-US</language>
<tags>test testing tdd framework fluent assert theory plugin addin</tags>
<references>
<reference file="nunit.framework.dll" />
</references>
</metadata>
</package>
Binary file added packages/NUnit.2.6.2/lib/nunit.framework.dll
Binary file not shown.

0 comments on commit 83aabea

Please sign in to comment.