void VerifyInvalid() { var registry = new AspectRegistry(); registry.Get().Open().Should().BeEmpty(); registry.Execute(new Registration(Never <Array <Type> > .Default, typeof(Aspect <,>))); registry.Get().Open().Should().HaveCount(1); var registrations = new AspectRegistrations <string, int>(registry); registrations.Get(GenericArguments.Default.Get(A.Type <ISelect <string, int> >())) .Open() .Should() .BeEmpty(); }
void Verify() { var registry = new AspectRegistry(); registry.Execute(new Registration(typeof(AssignedAspect <,>))); var subject = Start.A.Selection <string>().By.Self.Get(); subject.Invoking(x => x.Get(null)).Should().NotThrow(); new Aspects <string, string>(registry).Get(subject) .Get(subject) .Invoking(x => x.Get(null)) .Should() .Throw <ArgumentNullException>(); }
/*public static ISelect<TIn, TOut> Configured<TIn, TOut>(this ISelect<TIn, TOut> @this) * => Aspects<TIn, TOut>.Default.Get(@this).Get(@this);*/ public static IAspect <TIn, TOut> Registered <TIn, TOut>(this AspectRegistry @this, IAspect <TIn, TOut> aspect) { @this.Execute(new Registration <TIn, TOut>(aspect)); return(aspect); }