public void CachingStream()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfigurationStream configuration1 =
                service.GetConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>();
            TestConfigurationStream configuration2 =
                service.GetConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>();

            CheckConfigurationStream(configuration1, configuration2);
        }
        public void Caching()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfiguration configuration1 =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>();
            TestConfiguration configuration2 =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>();

            CheckConfiguration(configuration1, configuration2);
        }
        public void CompleteCacheClearing()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfiguration configuration1 =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>();

            service.ResetCachedConfigurations();
            TestConfiguration configuration2 =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>();

            CheckConfiguration(configuration1);
            CheckConfiguration(configuration2);
            Assert.Throws <EqualException>(() => Assert.Equal(configuration1, configuration2));
        }
        public void SpecificCacheClearingStream()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfigurationStream configuration1 =
                service.GetConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>();

            service.ClearConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>();
            TestConfigurationStream configuration2 =
                service.GetConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>();

            CheckConfigurationStream(configuration1);
            CheckConfigurationStream(configuration2);
            Assert.Throws <EqualException>(() => Assert.Equal(configuration1, configuration2));
        }
        public void ReflectingMetadataStream()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfigurationStream configuration =
                service.GetConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>();

            CheckConfigurationStream(configuration);
        }
        public void ReflectingMetadata()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfiguration configuration =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>();

            CheckConfiguration(configuration);
        }
        public void ProvidingMetadata()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfigurationMetadata metadata      = new TestConfigurationMetadata();
            TestConfiguration         configuration =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>(metadata);

            CheckConfiguration(configuration);
        }
        public void ProvidingMetadataStream()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfigurationMetadataStream metadata      = new TestConfigurationMetadataStream();
            TestConfigurationStream         configuration =
                service.GetConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>(metadata);

            Assert.True(metadata.UsedAtLeastOnce);
            CheckConfigurationStream(configuration);

            service.ResetCachedConfigurations();
            TestConfigurationStream configuration2 =
                service.GetConfiguration <TestConfigurationStream, TestConfigurationMetadataStream>(metadata);

            CheckConfigurationStream(configuration2);
            Assert.NotEqual(configuration, configuration2);
            Assert.True(metadata.UsedAtLeastOnce);
            Assert.True(metadata.StreamGotDisposed);
        }
        public void SpecificCacheClearingMultiple()
        {
            DefaultConfigurationService service = GenerateService();

            TestConfiguration configuration1 =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>();
            TestConfiguration2 configurationt1 =
                service.GetConfiguration <TestConfiguration2, TestConfigurationMetadata2>();

            service.ClearConfiguration <TestConfiguration, TestConfigurationMetadata>();
            TestConfiguration configuration2 =
                service.GetConfiguration <TestConfiguration, TestConfigurationMetadata>();
            TestConfiguration2 configurationt2 =
                service.GetConfiguration <TestConfiguration2, TestConfigurationMetadata2>();

            CheckConfiguration(configuration1);
            CheckConfiguration(configuration2);
            Assert.Throws <EqualException>(() => Assert.Equal(configuration1, configuration2));
            CheckConfiguration2(configurationt1, configurationt2);
        }