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
public abstract class GivenA<T> where T : class | |
{ | |
private MoqAutoMocker<T> _autoMocker = new MoqAutoMocker<T>(); | |
protected T Target { get; private set; } | |
[SetUp] | |
public void Setup() | |
{ | |
Given(); |
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
using System; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Filters; | |
using Raven.Client; | |
namespace MyWebApi.Attributes | |
{ | |
public class AggressivelyCacheAttribute : ActionFilterAttribute | |
{ | |
public IDocumentStore DocumentStore { get; set; } |
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
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<RootNamespace>AutoUpdater</RootNamespace> | |
<AssemblyName>AutoUpdater</AssemblyName> | |
<!-- begin include --> | |
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> | |
<IsWebBootstrapper>true</IsWebBootstrapper> | |
<Install>true</Install> | |
<InstallFrom>Web</InstallFrom> |
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
AddMap<Pixel>(pixels => | |
from p in pixels | |
from tag in (p.Tags == null || !p.Tags.Any()) | |
? new[] {"_notags_"} | |
: p.Tags | |
select new GroupedResult | |
{ | |
Tag = tag, | |
PixelIds = new[] {p.Id}, | |
Urls = new[] {(string) null} |
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
public static class HttpContextBaseExtenstions | |
{ | |
public static void SetSubdomainSafeCookie(this HttpContextBase context, string name, string value) | |
{ | |
var domain = String.Empty; | |
if (!context.Request.IsLocal) | |
{ | |
var domainSegments = context.Request.Url.Host.Split('.'); | |
domain = "." + String.Join(".", domainSegments.Skip(1)); |
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
app.directive('linkedSlider', function () { | |
return { | |
restrict: 'A', | |
scope: { | |
value: '=', | |
link: '=', | |
step: '@', | |
min: '@', | |
max: '@', | |
condition: '&' |
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
MyProject.deploy.cmd | |
/y /M:https://MyHostMachine:8172/MsDeploy.axd | |
/u:MyUserName /p:MyPassword /A:Basic -allowUntrusted | |
"-setParam:name='IIS Web Application Name',value='MyIISWebAppName'" |
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
namespace Domain | |
{ | |
public interface IMyInterface | |
{ | |
string MyProperty { get; set; } | |
void PerformAction(); | |
decimal MethodWithParameters(decimal a, int b); | |
} |
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
public class ScoreChecker | |
{ | |
public IPlayer GetScoredPlayer(IPlayer player) | |
{ | |
if (player.Score > 8) | |
{ | |
return new HighScorePlayer(player); | |
} | |
if (player.Score > 2) |
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
public class WhenICreateIdentifierFromRequest : WithSubjectAndResult<ScoreResourceIdentifierFactory, ScoreResourceIdentifier> | |
{ | |
static CreateScoreResourceRequest _createScoreResourceRequest; | |
Establish _context = () => The<IObjectHasher>().WhenToldTo(m => m.CreateHashFor(_createScoreResourceRequest)).Return("hash"); | |
Because _of = () => Result = Subject.CreateIdentifierFromRequest(_createScoreResourceRequest); | |
It _createsAHashFromTheObject = () => The<IObjectHasher>().WasToldTo(m => m.CreateHashFor(_createScoreResourceRequest)); |
OlderNewer