File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,9 +22,7 @@ public bool CanCreate(Type componentType)
2222 public IComponent Create ( Type componentType )
2323 {
2424 var typeToCreate = StubType . MakeGenericType ( componentType ) ;
25- return replacementContent is not null
26- ? ( IComponent ) Activator . CreateInstance ( typeToCreate , new object ? [ ] { replacementContent } ) !
27- : ( IComponent ) Activator . CreateInstance ( typeToCreate , Array . Empty < object ? > ( ) ) ! ;
25+ return ( IComponent ) Activator . CreateInstance ( typeToCreate , new object ? [ ] { replacementContent } ) ! ;
2826 }
2927}
3028#endif
Original file line number Diff line number Diff line change @@ -16,20 +16,20 @@ public sealed class Stub<TComponent> : ComponentDoubleBase<TComponent>
1616 /// <summary>
1717 /// Initializes a new instance of the <see cref="Stub{TComponent}"/> class.
1818 /// </summary>
19- internal Stub ( ) { }
19+ public Stub ( ) { }
2020
2121 /// <summary>
2222 /// Initializes a new instance of the <see cref="Stub{TComponent}"/> class
2323 /// that uses the provided <paramref name="replacement"/> when rendering.
2424 /// </summary>
2525 /// <param name="replacement">The replacement template to use when rendering.</param>
26- internal Stub ( object replacement )
26+ public Stub ( object ? replacement )
2727 {
2828 if ( replacement is RenderFragment < CapturedParameterView < TComponent > > replacementTemplate )
2929 this . replacementTemplate = replacementTemplate ;
3030 else if ( replacement is RenderFragment replacementFragment )
3131 this . replacementFragment = replacementFragment ;
32- else
32+ else if ( replacement is not null )
3333 throw new ArgumentException ( $ "The type of replacement is not supported. Replacement type = { replacement . GetType ( ) } ", nameof ( replacement ) ) ;
3434 }
3535
You can’t perform that action at this time.
0 commit comments