コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }