Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Linq;
using MediatR;
using Should;
using static Testing;
public static class Assertions
{
public static void ShouldValidate<TResponse>(this IRequest<TResponse> message)
{
public static class TestDependencyScope
{
private static IContainer _currentNestedContainer;
public static void Begin()
{
if (_currentNestedContainer != null)
throw new Exception("Cannot begin test dependency scope. Another dependency scope is still in effect.");
_currentNestedContainer = IoC.Container.GetNestedContainer();
public class AutoMapperTests
{
public void ShouldHaveValidConfiguration()
{
Mapper.AssertConfigurationIsValid();
}
}
using System.Linq;
using ContactList.Core.Domain;
using ContactList.Tests;
using static Testing;
public class EntityTests
{
[AllEntities]
public void ShouldPersist<TEntity>(TEntity entity) where TEntity : Entity
{
@plioi
plioi / appveyor.yml
Created January 8, 2016 04:32
A basic AppVeyor configuration starting point.
version: '{build} ({branch})'
skip_tags: true
init:
- cmd: git config --global core.autocrlf true
build_script:
- cmd: build
test: off
@plioi
plioi / Retry.cs
Last active August 29, 2015 14:17
Fixie Convention - Retry on SQL Timeouts
public class IntegrationTestConvention : Convention
{
public IntegrationTestConvention()
{
Classes
.NameEndsWith("Tests");
Methods
.Where(method => method.IsVoid() || method.IsAsync());
public class NoSeriouslyDudeMarshalByRefObject : MarshalByRefObject, IDisposable
{
public override sealed object InitializeLifetimeService()
{
return null; //Prevent the object from being ruined after 6 or so minutes.
}
public void Dispose()
{
RemotingServices.Disconnect(this); //Avoid the memory leak otherwise introduced above.
public class SamplesAssembly : TestAssembly
{
public SamplesAssembly()
{
Apply<Categories.CustomConvention>();
Apply<Explicit.CustomConvention>();
Apply<Inclusive.CustomConvention>();
Apply<IoC.CustomConvention>();
Apply<LowCeremony.CustomConvention>();
Apply<NUnitStyle.CustomConvention>();

The Heartbleed bug is a serious internet security issue that's even worse than it sounds.

Imagine that when everyone wakes up tomorrow, we all realize something fishy on our front doors. Right beside the door lock, the key to the door has been taped to the door! Anyone who walks by could use it to come and go as they please. Suppose we all also realize that our keys have been taped to our doors like this for two whole years now.

If criminals happened to notice the keys were so handy during those two years, then they've had the run of the place for that whole time. Regardless of whether criminals knew about the keys during those two years, they definitely know about it this week.

This week, all the affected websites are in a mad scramble to remove the keys from their own front doors. At the same time, criminals are in a mad scramble to walk up to every door, make a copy of the key, and put back the original so nobody knows they were there.

Responsible organizations who understand the problem are bo

Test 'CalculatorTests.ShouldAdd' failed:
Expected 999 but was 5.
CalculatorTests.cs(14,0): at CalculatorTests.ShouldAdd()
Test 'CalculatorTests.ShouldSubtract' failed:
Expected 999 but was 2.
CalculatorTests.cs(19,0): at CalculatorTests.ShouldSubtract()