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
Copy file name to clipboardExpand all lines: AutofacContrib.NSubstitute/AutoSubstituteBuilder.cs
+37-16Lines changed: 37 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -126,30 +126,26 @@ public AutoSubstituteBuilder Provide<TService>(TService instance, object service
126
126
}
127
127
128
128
/// <summary>
129
-
/// Registers to the container and returns a substitute for a given concrete class given the explicit constructor parameters.
129
+
/// Registers a substitute to the container a given concrete class given the explicit constructor parameters using <see cref="Substitute.For{TService}(object[])"/>.
130
130
/// This is used for concrete classes where NSubstitutes won't be created by default by the container when using Resolve.
131
-
/// For advanced uses consider using directly <see cref="Substitute.For{TService}"/> and then calling <see cref="Provide{TService}(TService)"/> so that type is used on dependencies for other Resolved types.
132
131
/// </summary>
133
132
/// <typeparam name="TService">The type to register and return a substitute for</typeparam>
/// Registers a substitute to the container a given concrete class given the explicit constructor parameters using <see cref="Substitute.ForPartsOf{TService}(object[])"/>.
141
+
/// This is used for concrete classes where NSubstitutes won't be created by default by the container when using Resolve.
142
+
/// </summary>
143
+
/// <typeparam name="TService">The type to register and return a substitute for</typeparam>
/// Used to identify if a builder was created by <see cref="AutoSubstituteBuilder.SubstituteFor{TService}(object[])"/> or <see cref="AutoSubstituteBuilder.SubstituteForPartsOf{TService}(object[])"/>.
Copy file name to clipboardExpand all lines: README.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,28 @@ public void SubstituteForConfigureWithContext()
187
187
}
188
188
```
189
189
190
-
Similarly, you can resolve a concrete type from the autosubstitute container and register that with the underlying container using the `ResolveAndSubstituteFor` method:
190
+
If you would rather register it using NSubstitute's `SubstituteForPartsOf` method, you may use the following:
Similarly, you can resolve a concrete type from the AutoSubstitute container and register that with the underlying container using the `ResolveAndSubstituteFor` method:
0 commit comments