public void CorrectRegistrationsDbUpdate() { var deployment = new ApplicationDeploymentAccessor(); var rhetosHostBuilder = new RhetosHostTestBuilder() .ConfigureConfiguration(RhetosHostTestBuilder.GetRuntimeConfiguration) .UseBuilderLogProvider(new NLogProvider()) .OverrideContainerConfiguration(deployment.SetDbUpdateComponents); using (var rhetosHost = rhetosHostBuilder.Build()) { var registrationsDump = DumpSortedRegistrations(rhetosHost.GetRootContainer()); System.Diagnostics.Trace.WriteLine(registrationsDump); TestUtility.AssertAreEqualByLine(_expectedRegistrationsDbUpdate, registrationsDump); TestAmbiguousRegistations(rhetosHost.GetRootContainer(), expectedOverridenRegistrations: new Dictionary <Type, string> { { typeof(IUserInfo), "NullUserInfo" } }); } }
public void CorrectRegistrationsRuntimeWithInitialization() { // we construct the object, but need only its 'almost' static .AddAppInitilizationComponents var deployment = new ApplicationDeploymentAccessor(); var rhetosHostBuilder = new RhetosHostTestBuilder() .ConfigureConfiguration(RhetosHostTestBuilder.GetRuntimeConfiguration) .ConfigureContainer(deployment.AddAppInitializationComponents); using (var rhetosHost = rhetosHostBuilder.Build()) { var registrationsDump = DumpSortedRegistrations(rhetosHost.GetRootContainer()); System.Diagnostics.Trace.WriteLine(registrationsDump); TestUtility.AssertAreEqualByLine(_expectedRegistrationsRuntimeWithInitialization, registrationsDump); TestAmbiguousRegistations(rhetosHost.GetRootContainer(), expectedMultiplePlugins: new[] { "Rhetos.Dsl.IDslModelIndex" }, expectedOverridenRegistrations: new Dictionary <Type, string> { { typeof(IUserInfo), "ProcessUserInfo" }, { typeof(ILogProvider), "NLogProvider" } }); } }