Skip to content

Instantly share code, notes, and snippets.

using NUnit.Framework;
using System.Collections.Generic;
namespace ClassLibrary
{
[TestFixture]
public class ChainingAssertionDemo
{
[Test]
public void IsStructuralEqual_should_be_make_easily_understandable_message_for_IDictionaryOfTKeyOfTValue()
function TypeToIdentity {
param (
[type]
$Type
)
if ($Type.HasElementType) {
$typeIdentity = TypeToIdentity $Type.GetElementType()
} else {
$typeIdentity = $Type.Name
@urasandesu
urasandesu / DateTime_Now_Indirect_v2.cs
Last active August 29, 2015 14:05
DateTime_Now_Indirect_v2.cs
namespace System
{
public struct DateTime
{
public static DateTime Now
{
get
{
try
{
using System;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
var interceptor = default(Func<Func<DateTime>, Func<DateTime>>);
interceptor = indirection => () =>
@urasandesu
urasandesu / PList`1.cs
Created August 15, 2014 01:35
Idea for intercepting an indirection.
using System.ComponentModel;
using Urasandesu.Prig.Framework;
namespace System.Collections.Generic.Prig
{
public class PList<T> : PListBase
{
public static zzAdd Add()
{
@urasandesu
urasandesu / refine_time_now.rb
Last active August 29, 2015 14:03
Refine Time.now
module Fake
refine Time.singleton_class do
def now
Time.local(2014, 1, 1)
end
end
end
def puts_original
p Time.now
@urasandesu
urasandesu / MockingDelegatesTest4.cs
Created June 24, 2014 13:50
How to use Prig in combination with FakeItEasy.
using FakeItEasy;
using NUnit.Framework;
using System;
using System.ComponentModel;
using System.Prig;
using Urasandesu.Prig.Framework;
namespace MockingDelegatesSample
{
[TestFixture]
@urasandesu
urasandesu / MockingDelegatesTest3.cs
Created June 24, 2014 13:19
How to use Prig in combination with Rhino Mocks.
using NUnit.Framework;
using Rhino.Mocks;
using System;
using System.ComponentModel;
using System.Prig;
using Urasandesu.Prig.Framework;
namespace MockingDelegatesSample
{
[TestFixture]
@urasandesu
urasandesu / MockingDelegatesTest2.cs
Created June 24, 2014 12:32
How to use Prig in combination with NSubstitute.
using NSubstitute;
using NUnit.Framework;
using System;
using System.ComponentModel;
using System.Prig;
using Urasandesu.Prig.Framework;
namespace MockingDelegatesSample
{
[TestFixture]
@urasandesu
urasandesu / MockingDelegatesTest.cs
Created June 22, 2014 01:49
How to use Prig in combination with Moq.
using Moq;
using NUnit.Framework;
using System;
using System.ComponentModel;
using System.Prig;
using System.Runtime.CompilerServices;
using Urasandesu.Prig.Framework;
namespace MockingDelegatesSample
{