Skip to content

Instantly share code, notes, and snippets.

View tonyjoanes's full-sized avatar
😏
LLM Learning

Tony Joanes tonyjoanes

😏
LLM Learning
View GitHub Profile
@tonyjoanes
tonyjoanes / gist:218a79435060c706fba3
Created October 13, 2014 14:19
Logging Aspect Interceptor
public class LoggingAspect : IInterceptor
{
private readonly ILogger logger;
private readonly Stopwatch stopwatch;
public LoggingAspect(ILogger logger)
{
this.logger = logger;
this.stopwatch = new Stopwatch();
}
@tonyjoanes
tonyjoanes / gist:d567beea64f6eb589066
Created October 10, 2014 15:21
MVC Route testing
[Test]
public void should_map_to_recipe_controller()
{
"~/Recipe".ShouldMapTo<recipecontroller>(action => action.Healthy());
}
@tonyjoanes
tonyjoanes / gist:5af399e23d10e1d2c942
Created October 10, 2014 15:15
MVC Route testing
[TestFixtureSetUp]
public void TestSetup()
{
var routes = RouteTable.Routes;
routes.Clear();
routes.MapRoute(
"Default",
"{controller}",
new {controller = "Recipe", action = "Healthy", id = ""}