Skip to content

Instantly share code, notes, and snippets.

View darrelmiller's full-sized avatar

Darrel darrelmiller

View GitHub Profile
<!--
***********************************************************************************************
Microsoft.Common.CurrentVersion.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
This file defines the steps in the standard build process for .NET projects. It
contains all the steps that are common among the different .NET languages, such as
@darrelmiller
darrelmiller / cacheimplementation.cs
Last active September 2, 2015 20:21 — forked from jchannon/cacheimplementation.cs
Nancy caching using Last-Modified/If-Modified-Since header
public class Cache : ICache
{
private ConcurrentDictionary<string, DateTime> cacheLookup = new ConcurrentDictionary<string,DateTime>();
public Response Get(NancyContext ctx)
{
DateTime lastmodified;
if(ctx.Request.Method == "GET" || ctx.Request.Method == "HEAD")
{
[Scenario]
public void RetrievingIssues(IEnumerable<Issue> issues, Mock<IIssueStore> issueStore )
{
var mockIssueStore = new Mock<IIssueStore>();
var fakeIssues = GetFakeIssues();
var controller = new IssueController(mockIssueStore.Object);
"Given existing issues".
f(() => mockIssueStore.Setup(i => i.FindAsync()).Returns(Task.FromResult(fakeIssues)));
"When a GET request is made for all issues".