void StObjInitialize(IActivityMonitor monitor, IStObjObjectMap map) { map.FinalImplementations .Count(f => f.Implementation is IRealObject && f.Implementation is not PocoDirectory) .Should().Be(2); Assert.That(StObjInitializeOnACalled); StObjInitializeOnASpecCalled = true; }
/// <summary> /// Configure the services (does nothing here: this just tests the parameter /// injection of the startup services). /// </summary> /// <param name="register">This one is the only required parameter.</param> /// <param name="ambientObjects"> /// IStObjObjectMap is available: configuring services can rely on any IRealObject since they are already initialized (this /// is even available in the RegisterStartupServices). /// </param> /// <param name="superService">This is injected.</param> /// <param name="ext">This is injected.</param> /// <param name="optionalService"> /// This is injected if it exists in the StartupServices: startup services can be optional. /// </param> void ConfigureServices(StObjContextRoot.ServiceRegister register, IStObjObjectMap ambientObjects, SuperStartupService superService, TotallyExternalStartupServiceThatActAsAConfiguratorOfTheWholeSystem ext, IOptionalStartupService?optionalService = null) { ambientObjects.Obtain <IA1>().Should().BeSameAs(this); superService.Should().NotBeNull(); ext.Should().NotBeNull(); superService.Talk(register.Monitor); }
/// <summary> /// Gets the structured object or null if no mapping exists. /// </summary> /// <param name="this">This context.</param> /// <typeparam name="T">Type (that must be a Real Object).</typeparam> /// <returns>Structured object instance or null if the type has not been mapped.</returns> public static T?Obtain <T>(this IStObjObjectMap @this) where T : class { return((T?)@this.Obtain(typeof(T))); }
void StObjInitialize(IActivityMonitor m, IStObjObjectMap map) => ++ StObjInitializeCallCount;