Skip to content

Instantly share code, notes, and snippets.

@herecydev
herecydev / Startup.cs
Created April 29, 2016 07:40
RedirectLoop
public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");
Configuration = builder.Build();
}
public IConfigurationRoot Configuration { get; set; }
@herecydev
herecydev / ValuesController.cs
Last active November 23, 2015 21:37
Kestrel https
using System.Collections.Generic;
using Microsoft.AspNet.Mvc;
namespace WebApplication1.Controllers
{
[Route("api/[controller]")]
[RequireHttps]
public class ValuesController : Controller
{
// GET: api/values
using Microsoft.ServiceBus.Messaging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace QueueClientRepro
{
namespace ClassLibrary1
{
public class Class1
{
public Class1()
{
var x = new DiagnosticMessage();
}
}
}
@herecydev
herecydev / gist:081a7703866f19005b95
Created April 24, 2015 08:12
Moq issue with many observers
public interface IMakeStuff : IObserver<int>, IObserver<string>, IObserver<bool> { }
public class Tests
{
[Fact]
public void SimpleTest()
{
var maker = new Mock<IMakeStuff>()
// Exception here
@herecydev
herecydev / ArrayTest
Created March 26, 2015 13:13
Xunit bug when data is an array
public class Tests
{
//Why is this not discovered?
[MyArrayTest]
public void ThisDoesntWork(byte[] bytes)
{
Xunit.Assert.True(true);
}
[MyStringTest]