示例#1
0
        public void RegisterInterceptors_RegisterInterceptors_AddedToInterceptorsCollection()
        {
            var interceptor = new TestInterceptor();

            ConfigurationManager.RegisterInterceptors(interceptor);

            Assert.That(ConfigurationManager.Interceptors[0], Is.EqualTo(interceptor));
        }
        public void RegisterInterceptors_RegisterInterceptors_AddedToInterceptorsCollection()
        {
            var interceptor = new TestInterceptor();

            ConfigurationManager.RegisterInterceptors(interceptor);

            Assert.That(ConfigurationManager.Interceptors[0], Is.EqualTo(interceptor));
        }
        public void AppSetting_WithInterceptor_CallsInterceptor()
        {
            var interceptor = new TestInterceptor();
            ConfigurationManager.RegisterInterceptors(interceptor);
            var appSettings = new NameValueCollection {{"key", "value"}};
            var cfgMgr = new ConfigurationManager(appSettings);

            cfgMgr.AppSettings.AppSetting("key");

            Assert.That(interceptor.Called, Is.True);
        }
示例#4
0
        public void AppSetting_WithInterceptor_CallsInterceptor()
        {
            var interceptor = new TestInterceptor();

            ConfigurationManager.RegisterInterceptors(interceptor);
            var appSettings = new NameValueCollection {
                { "key", "value" }
            };
            var cfgMgr = new ConfigurationManager(appSettings);

            cfgMgr.AppSettings.AppSetting("key");

            Assert.That(interceptor.Called, Is.True);
        }