private static ModuleInvocation GetModuleInvocation() { var bldr = new ModuleInvocationBuilder(); bldr.AddModule <IService>(); return(bldr.Build()); }
public void ModuleInvocationBuilder_ShouldHandleMultipleModules() => Assert.DoesNotThrow(() => { var bldr = new ModuleInvocationBuilder(); foreach (Type iface in RandomInterfaces) { bldr.AddModule(iface); } bldr.Build(); });
public void GlobalSetup() { Container = new ServiceContainer(); Container.Service <IModule, Module>(Lifetime.Scoped); var bldr = new ModuleInvocationBuilder(); bldr.AddModule <IModule>(); Invoke = bldr.Build(); Context = new RequestContext(null, nameof(IModule), nameof(IModule.Foo), Payload, default); }
public void ModuleInvocationBuilder_ShouldThrowOnByRefParameter() => Assert.Throws <ArgumentException>(() => { var bldr = new ModuleInvocationBuilder(); bldr.AddModule <IDictionary <string, string> >(); });
public void ModuleInvocationBuilder_ShouldWorkWith(Type iface) => Assert.DoesNotThrow(() => { var bldr = new ModuleInvocationBuilder(); bldr.AddModule(iface); bldr.Build(); });