Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add slides fixes
- Loading branch information
unknown
committed
Apr 26, 2013
1 parent
7f6a95c
commit 83aabea
Showing
18 changed files
with
16,683 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-clear redis | ||
--redis-cli -h ahost -p aport -a password | ||
|
||
-ALWAYS HAVE REDIS RUNNING - CHANGE TO LOCALHOST | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 not shown.
Oops, something went wrong.