Questions tagged [rhino-mocks]

Rhino.Mocks is a dynamic mock object framework for the .NET platform. Rhino.Mock's purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

Rhino.Mocks is a dynamic mock object framework for the .NET platform. Rhino.Mock's purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

To get started, take a look at the useful manual full of examples for .NET version 3.5. For more information, see the wiki for Rhino.Mocks or the documentation (source code in GitHub).

Installation RhinoMocks can most easily be installed through its NuGet package.

Install-Package RhinoMocks 
1223 questions
-1
votes
1 answer

Mock a concrete class

I know that it is not possible to Mock a concrete class but only interfacecs and abstract classes. Is there any way or any pattern to skirt this? For example I have the following classes that do not implement any interface. I don't want to create a…
ehh
  • 3,412
  • 7
  • 43
  • 91
-1
votes
3 answers

Rhinomocks DynamicMock question

My dynamic mock behaves as Parial mock, meaning it executes the actual code when called. Here are the ways I tried it var mockProposal = _mockRepository.DynamicMock(); SetupResult.For(mockProposal.CreateMarketingPlan(null, null,…
epitka
  • 17,275
  • 20
  • 88
  • 141
-1
votes
1 answer

C# Mock Testing

I have a unit test which logs onto a database and checks the username and password, but I need to recreate these test now using mocks. I have been searching online but cannot find anything like what I am trying to achieve. Below is the original…
Alan Mulligan
  • 1,107
  • 2
  • 16
  • 35
-1
votes
1 answer

How to mock not implemented Dependency injection?

I want to unit test the following code.right now I'm using NUnit with Rhino Mock. Note: All the NUnit test cases should not do any database operation interface IdbOperation { int insert(); } public class databaseactivity:IdbOperation…
-1
votes
1 answer

Rhino mock questions

Simple Rhino mock questions. what's the difference between replay and replayAll? What's the difference between SetupResult.On(Of T).Call vs Expect.Call(Of T)? What's BackToRecord used for?
Joe Web
  • 128
  • 1
  • 1
  • 7
-1
votes
2 answers

How to mock/ioc a class in a static class?

I have class which calls a static class, the static class basically is wrapper for another class. I know i can't mock/ioc static classes but can do this for the non-static class? below is a sample of my code structure namespace lib.CanModify { …
-2
votes
1 answer

Expect call is not working on mock

I am writing test for CheckPassWord() I presume the Expect call is not behaving as expected on my userMangerMock. //CheckPassword returns true if the parameter matches to the exsting user. //Existing user is obtained by GetUser() by internal call …
Srikanth
  • 980
  • 3
  • 16
  • 30
-3
votes
2 answers

Assert Statement for ternary operator in Rhino mocks?

x(string)= y(string) != ? y : string.empty How to get 100% code coverage for above line using Assert statement We've tried using: Assert.AreEqual(Actualvalue,ExpectedValue); but we are missing code coverage somewhere
1 2 3
81
82