rhino mocks mocking a call -
I have a method that I want to test that hits the database with a fake use of what I've read To have the perfect oppurtunity. However, the problem I am facing is that I pass an object to a string and then it creates an object and hits DB with this object.
Public Zero Test (String T) {Test T1 = New Test (T); Db.Save (T1); }
Then I have a test in:
using (joke record) {hope. Call (db.Save (???))}
Having trouble - what do I expect from here? A call:
Expect.call (db.Save (New Test (T))
does not work.
That I am new to joking, this can be a simple question, but any help would be greatly appreciated.
thanks
public zero test (string t) {test t1 = new test (t);); Use of "=" text => (Junk Record) (Hopefully Call (DB.Save (T1)); (Spider Playback ()) {DB Save (T1);} Funny. Verify ();}
But this is probably to be limited. Then you can actually define the criterion which is to fill the argument. For example:
using (joke record) {test example. Compimp = new test t); Hope. Call (DB Save (Arg . Iqual (instanceToCompare))}}
or any other example:
Use (Fun.Recorded) {Hope.Call (DB Save (Arg <> Test> Atches (T => t.Name.Length.Equals ("Test"))); }
Comments
Post a Comment