-
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
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Ok, is it just me, or does there seem to be a lack of (easy to find) reference documentation for Rhino Commons and Rhino Mocks? My coworkers have started using Rhino Mocks and Rhino Commons (particularly the NHibernate stuff), and I found a few tutorial-ish examples, which were good. But when I…
>>> 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'
For my java program I'm using Rhino to execute JS scripts. Now I'm trying to convert it to an applet which works great, except that everytime it's calling evaluateString(...) the JVM throws an AccessControlException. After some (a lot) of research I found out that this is caused by Rhino's custom…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm trying to set up blade unit tests in an MVC Turbine-derived site. The problem is that I can't seem to mock the IServiceLocator interface without hitting the following exception:
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT:…
>>> More