-
as seen on ASP.net Weblogs
- Search for 'ASP.net Weblogs'
In a recent StackOverflow question, someone showed some sample code they’d like to be able to use. The particular syntax they used isn’t supported by Rhino.Mocks, but it was an interesting idea that I thought could be easily implemented with an extension method. Background When stubbing a…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
My unit test keeps getting the following error: "System.InvalidOperationException: The Connection is not open."
The Test
[TestFixture]
public class Test
{
[Test]
public void Test1()
{
NpgsqlConnection connection = MockRepository.GenerateStub<NpgsqlConnection>();
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am new to mocking and dependency injection and need some guidance.
My application is using a typical N-Tier architecture where the BLL references the DAL, and the UI references the BLL but not the DAL. Pretty straight forward.
Lets say, for example, I have the following classes:
class MyDataAccess…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I've spent a good part of the day trying to figure out why a simple RhinoMocks test doesn't return the value I'm setting in the return. I'm sure that I'm just missing something really simple but I can't figure it out. Here's my test:
[TestMethod]
public void CopyvRAFiles_ShouldCallCopyvRAFiles_ShouldReturnTrue2()
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
What would a simple unit test look like to confirm that a certain controller exists if I am using Rhino Mocks, NUnit and ASP.NET MVC 2? I'm trying to wrap my head around the concept of TDD, but I can't see to figure out how a simple test like "Controller XYZ Exists" would look. In addition, what…
>>> More