You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assign custom behavior to most methods by using the assignment operator.
publicvoidSimpleMethodUsageStub(){varstub=newStubExample();IExampleexample=stub;// setup a method by assigning a function to that methodstub.VoidMethod=()=>{};// you can even call the method the normal way from the stub.stub.VoidMethod();// methods that return something are setup in the same waystub.StructMethod=()=>7;varresult=stub.StructMethod();Assert.Equal(7,result);Assert.Equal(7,example.StructMethod());}