github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jcbozonier / CrutchMocks

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • 8b757bec1fe5cc3a0de7190cfc456e421fc9ff3a
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Extremely simplistic mocking library to help those new to TDD not have to focus on their mocking library. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Removed superfluous code 
Justin Bozonier (author)
Sat Oct 31 09:38:47 -0700 2009
commit  6db025c7bf65d17b9ac41de2c9f34feee4963b56
tree    602222412bc199a8a03fd4c95db60ce0cb2547a5
parent  c87821da554f2a7848935b30ae01e022552ac22e
CrutchMocks / MiniMock / TestProject / When_executing_a_mocked_method_that_has_a_return_value_of_some_type.cs MiniMock/TestProject/When_executing_a_mocked_method_that_has_a_return_value_of_some_type.cs
100644 191 lines (155 sloc) 4.021 kb
edit raw blame history
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
using System;
using MiniMock.Mocking;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
 
namespace TestProject
{
[TestFixture]
    public class When_executing_a_mocked_method_that_has_NO_return_value_and_multiple_parameters
    {
        private IFoo MockedObject;
 
[Test]
 
        public void It_should_execute_with_no_error()
        {
        }
 
[SetUp]
        public void Setup()
        {
            MockedObject = Mockery.Mock<IFoo>();
            Because();
        }
 
        private void Because()
        {
            MockedObject.Bar(3, 6);
        }
 
        public interface IFoo
        {
            void Bar(int x, object y);
        }
    }
 
[TestFixture]
    public class When_executing_a_mocked_method_that_has_a_return_value_of_null_and_multiple_parameters
    {
        private IFoo MockedObject;
        private object ReturnedValue;
 
[Test]
 
        public void It_should_return_the_default_value()
        {
            Assert.That(ReturnedValue, Is.EqualTo(null));
        }
 
[SetUp]
        public void Setup()
        {
            MockedObject = Mockery.Mock<IFoo>();
            Because();
        }
 
        private void Because()
        {
            ReturnedValue = MockedObject.Bar(3, 6);
        }
 
        public interface IFoo
        {
            IDisposable Bar(int x, object y);
        }
    }
 
[TestFixture]
    public class When_executing_a_mocked_method_that_has_a_return_value_of_null_and_parameters
    {
        private IFoo MockedObject;
        private object ReturnedValue;
 
[Test]
        public void It_should_return_the_default_value()
        {
            Assert.That(ReturnedValue, Is.EqualTo(null));
        }
 
[SetUp]
        public void Setup()
        {
            MockedObject = Mockery.Mock<IFoo>();
            Because();
        }
 
        private void Because()
        {
            ReturnedValue = MockedObject.Bar(2);
        }
 
        public interface IFoo
        {
            object Bar(int param1);
        }
    }
 
[TestFixture]
    public class When_executing_a_mocked_method_that_has_a_return_value_of_null
    {
        private IFoo MockedObject;
        private object ReturnedValue;
 
[Test]
 
        public void It_should_return_the_default_value()
        {
            Assert.That(ReturnedValue, Is.EqualTo(null));
        }
 
[SetUp]
        public void Setup()
        {
            MockedObject = Mockery.Mock<IFoo>();
            Because();
        }
 
        private void Because()
        {
            ReturnedValue = MockedObject.Bar();
        }
 
        public interface IFoo
        {
            IDisposable Bar();
        }
    }
 
[TestFixture]
    public class When_executing_a_mocked_method_that_has_a_return_value_of_type_bool
    {
        private IFoo MockedObject;
        private bool ReturnedValue;
 
[Test]
 
        public void It_should_return_the_default_value()
        {
            Assert.That(ReturnedValue, Is.EqualTo(false));
        }
 
[SetUp]
        public void Setup()
        {
            MockedObject = Mockery.Mock<IFoo>();
            Because();
        }
 
        private void Because()
        {
            ReturnedValue = MockedObject.Bar();
        }
 
        public interface IFoo
        {
            bool Bar();
        }
    }
 
[TestFixture]
    public class When_executing_a_mocked_method_that_has_a_return_value_of_type_int
    {
        private IFoo MockedObject;
        private int ReturnedValue;
 
[Test]
 
        public void It_should_return_the_default_value()
        {
            Assert.That(ReturnedValue, Is.EqualTo(0));
        }
 
[SetUp]
        public void Setup()
        {
            MockedObject = Mockery.Mock<IFoo>();
            Because();
        }
 
        private void Because()
        {
            ReturnedValue = MockedObject.Bar();
        }
 
        public interface IFoo
        {
            int Bar();
        }
    }
}
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server