public void InitializeSplat_RegistrationsNotEmptyNoRegistrations() { // this is using the internal constructor var testLocator = new InternalLocator(); var logManager = testLocator.Current.GetService(typeof(ILogManager)); var logger = testLocator.Current.GetService(typeof(ILogger)); Assert.NotNull(logManager); Assert.NotNull(logger); Assert.IsType <DebugLogger>(logger); Assert.IsType <DefaultLogManager>(logManager); }
public void WithResolver_NotificationsDontHappen() { int numberNotifications = 0; Action notificationAction = () => numberNotifications++; var testLocator = new InternalLocator(); testLocator.RegisterResolverCallbackChanged(notificationAction); using (testLocator.Internal.WithResolver()) { using (testLocator.Internal.WithResolver()) { } } // 1 due to the fact the callback is called when we register. Assert.Equal(1, numberNotifications); }