SetupResult.cs |
SetupResult.csSummary
ForSets the last method call to repeat any number of times and return the method options for the last method call, which usually will be a method call or property that is located inside the For. See Expected Usage. Expected usageSetupResult.For(mockObject.SomeCall()).Return(new Something()); Thread safetyThis method is not safe for multi threading scenarios! If you need to record in a multi threading environment, use the On method, which can handle multi threading scenarios. OnSets the last method call to repeat any number of times and return the method options for the last method call on the mockInstance. Unless you’re recording in multiply threads, you are probably better off using For Expected usageSetupResult.On(mockList).Call(mockList.Count).Return(50); Thread safetyThis method can be used in mutli threading scenarios. |