blob: 75e1f00e8ce7046da82b55730533580acfc3172b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
using System;
using System.Collections.Generic;
using System.Linq;
using Calculator.Infrastructure.Extensions;
using MbUnit.Framework;
namespace Calculator.Test.Extensions {
public static class AssertionExtensions {
public static void ShouldBeEqualTo< T >( this T itemToCheck, T valueToBeEqualTo ) {
Assert.AreEqual( valueToBeEqualTo, itemToCheck );
}
public static void ShouldContainItemWhere< T >( this IEnumerable< T > items, Predicate< T > criteria ) {
if ( items.WhereCriteriaIsSatisfiedBy( criteria ).Count() != 1 ) {
Assert.Fail( "The item was not found in the collection." );
}
}
}
}
|