summaryrefslogtreecommitdiff
path: root/src/specs/Mock.cs
blob: 5ecdae26b7159a4ebe421c9ab8fb15cd46af44ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using Rhino.Mocks;

namespace specs
{
    public static class Mock
    {
        public static T an<T>() where T : class
        {
            return MockRepository.GenerateMock<T>();
        }

        public static void received<T>(this T mock, Action<T> command)
        {
            mock.AssertWasCalled(command);
        }

        public static void should_not_have_received<T>(this T mock, Action<T> command)
        {
            mock.AssertWasNotCalled(command);
        }
    }
}