Skip to content

Instantly share code, notes, and snippets.

@ehvattum
Last active February 10, 2016 16:05
Show Gist options
  • Save ehvattum/e9d061d9bd51a621b390 to your computer and use it in GitHub Desktop.
Save ehvattum/e9d061d9bd51a621b390 to your computer and use it in GitHub Desktop.
#region License
// --------------------------------------------------
// Copyright © PayEx. All Rights Reserved.
//
// This software is proprietary information of PayEx.
// USE IS SUBJECT TO LICENSE TERMS.
// --------------------------------------------------
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using NUnit.Framework.Constraints;
namespace JAY_Z
{
[TestFixture]
public class BitchTests
{
[Test]
public void AssertMe()
{
Assert.That(
I.Got<Problem>(99), But.A<Bitch>().Aint.One()
);
}
}
public class But
{
internal Type What;
public Tuple<ConstraintExpression, But> Aint => new Tuple<ConstraintExpression, But>(Is.Not, this);
public static But A<T>()
{
return new But
{
What = typeof(T)
};
}
}
public class Problem : Exception
{
}
public class Bitch : Problem
{
}
public static class I
{
public static void A<TBithc>(this IEnumerable<Problem> problems)
{
}
public static IEnumerable<T> Got<T>(int problems) where T : Problem, new()
{
return Enumerable.Range(0, problems).Select(r => new T());
}
public static IResolveConstraint One(this Tuple<ConstraintExpression, But> stuff)
{
return stuff.Item1.TypeOf(stuff.Item2.What);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment