Omgili - forum search, search forums  
  

Discussions about mock

Displaying 1 - 10 out of 76,753 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
Does anyone have an implementation lying around of an auto-mock container using Rhino Mocks and NInject?
Started by on , 3 posts by 3 people.  
You need these 3 classes: public class AutoMockingKernel : StandardKernel { private readonly IMockProvider... .
It is very simple.
OK I built one myself using the Moq integration as a starting point .
There is a Moq integration available.
Not that I have seen.
How do I test the following code with mocks (using mocks, the patch decorator and sentinels provided by Michael Foord's Mock framework ): def testme(filepath): with open(filepath, 'r') as f: return f.read()
Started by on , 3 posts by 3 people.  
So the mock of open needs to also to return the file handle mock that will register the call to the read() method in the code above: @patch('__builtin__.open') def test_testme....
When used in a with statement, open returns a context manager .
How do I mock an object with a constructor using Rhino Mocks? For example how would this object be mocked... public class Foo : IFoo { private IBar bar; public Foo (IBar bar) { this.bar = bar } public DoSomeThingAwesome() { //awesomeness happens here ...
Started by on , 4 posts by 4 people.  
You should try to avoid having.
To test Foo itself, you mock IBar and pass the mock into the constructor.
MyIFoo.AssertWasCalled(f => f.DoSomethingAwesome()); You don't mock Foo - you mock IFoo .
Ask your Facebook Friends
Hi, Is it possible to create a "strict" mock using the new AAA syntax of Rhino Mocks? The issue I am seeing is that the library I am mocking often returns null as a valid return value (which I handle in my function), so using the default mock I can never...
Started by on , 4 posts by 4 people.  
Ayende talks more about.
Just not under the new syntax.
StrictMock is still available for use.
MockRepository.GenerateMock<T>() should return a 'strict' mock - as opposed mock.
I've recently came across different tutorials, where people use both mock and mock_model functions. In RSpec tutorial for controllers they use the mock_model function, but right in the documentation of RSpec , there is only mock function, but no mock_...
Started by on , 3 posts by 3 people.  
As jenger said mock_model is an extension built for active record: This is the source in 1.2.6:....
From: Useful helpers for RSpec mocks Firstly, mock_model automatically defines unique ids of the id) and new_record? (returns false).
ADO.NET has the notorious DataRow class which you cannot instantiate using new. This is a problem now that I find a need to mock it using Rhino Mocks. Does anyone have any ideas how I could get around this problem?
Started by on , 3 posts by 3 people.  
Its curious as to why you ....
Any time I can't mock something (I prefer MoQ over Rhino, but that's beside the point) I have such as TypeMock that can mock ANY class, or code a wrapper around classes that weren't written to be mocked.
I tried with NMock2 but I get TypeLoadExceptions when trying to pass the mocks into the constructor, also I saw TypeMock can do that but it costs 80$
Started by on , 3 posts by 3 people.  
New MockRepository(); // IService.Execute(out int result); var mock = mockRepository.CreateStub<.
I am having issues mocking an array with Rhino Mock, any direction would be great. namespace Checks_Rhino_Mocks { public class Check { public Header header; public Detail[] details; } public class Header { public string Number; public decimal Amount; ...
Started by on , 3 posts by 3 people.  
To solve[] details; } But...and here's the real point....
RhinoMocks, Moq, etc, can't mock non-virtual methods.
You can't mock Check.details because it's not virtual.
Mock.StrictMock<IEnumerable<Detail>>(); instead of an array...
How can i assert that a method on a mocked object was called exactly called n-times? Here is the code snippet from a controller action, i like to test: for (int i = 0; i <= newMatchCommand.NumberOfMatchesToCreate; i++) { serviceFacade.CreateNewMatch...
Started by on , 3 posts by 3 people.  
Better yet: mockObject.AssertWasCalled(x => x.SomeMethod(), opt => opt.Repeat.Times(n));.
Try Expect.Call(method).Repeat.Times(n).
Hi guys, I'm really getting to TDD recently, and after reading Kent Beck's book on Test Driven Development, I've still got many questions around test design in my mind. One of the issues I'm currently having is the use of Mock objects. Take below a very...
Started by on , 5 posts by 5 people.  
Mock....
By giving mock versions of the three sysX objects to MakeFinancialReport you remove their complexity and just test MakeFinancialReport .
If MakeFinancialReport , sys1 , sys2.
You should only use mock objects when they're helpful.
Page: 1   2   3   4   5   6   7   8   9   10  
Related Searches
NBA mock    MOCKING    ppr mock draft    2010 mock draft    mock draft 09    09 mock draft    rival mock draft    PPR mock draft Aug 2008    2008 ppr mock draft    09 mlb mock draft   
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost