What's new? | Help | Directory | Sign in
Google
codeincubator
A repository of code we're cookin' up.
  
  
  
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using MbUnit.Framework;
using Rhino.Mocks;

namespace CodeInc.Commons.Testing
{
[TestFixture]
public class Specification
{
private MockRepository _mocks;
public MockRepository Mocks
{
get { return _mocks; }
}

public void BackToRecord(object mockObject)
{
Mocks.BackToRecord(mockObject);
}

public IDisposable Record
{
get { return _mocks.Record(); }
}

public IDisposable Playback
{
get { return _mocks.Playback(); }
}

public IDisposable PlaybackOnly
{
get
{
using (Record)
{
}
return Playback;
}
}

public T Mock<T>()
{
return Mocks.DynamicMock<T>();
}

public T StrictMock<T>()
{
return Mocks.CreateMock<T>();
}

public T Stub<T>()
{
return Mocks.Stub<T>();
}

[SetUp]
public void Setup()
{
_mocks = new MockRepository();

before_each();
}

public virtual void before_each()
{
}

[TearDown]
public void Teardown()
{
after_each();
}

public virtual void after_each()
{
}
}
}
Show details
Hide

Change log

r37 by steveharman on May 08, 2008   Diff
tweaked Specification: can now create
Stubs, StrictMock, and dynamic mocks
(default)

Older revisions

r35 by steveharman on May 08, 2008   Diff
tweaking Specification and adding
Range, RangeExtensions, and tests
r20 by steveharman on Feb 28, 2008   Diff
Tweaking some of the BDD syntax
helpers
All revisions of this file

File info

Size: 1528 bytes, 79 lines