public void Generic_Configure_WhenCalledTwice_StillHasOneConfig()
        {
            var configs = new StructureTypeConfigurations();
            IStructureTypeConfig config1 = null;
            IStructureTypeConfig config2 = null;

            configs.Configure<Dummy>(cfg => { config1 = cfg.Config; });
            configs.Configure<Dummy>(cfg => { config2 = cfg.Config; });

            Assert.AreSame(config1, config2);
            Assert.AreEqual(1, configs.Items.Count());
        }
Exemplo n.º 2
0
        public void Generic_Configure_WhenCalledTwice_StillHasOneConfig()
        {
            var configs = new StructureTypeConfigurations();
            IStructureTypeConfig config1 = null;
            IStructureTypeConfig config2 = null;

            configs.Configure <Dummy>(cfg => { config1 = cfg.Config; });
            configs.Configure <Dummy>(cfg => { config2 = cfg.Config; });

            Assert.AreSame(config1, config2);
            Assert.AreEqual(1, configs.Items.Count());
        }
        public void IsEmpty_WhenSpecificConfigurationExists_ReturnsTrue()
        {
            var configs = new StructureTypeConfigurations();
            configs.Configure<Dummy>(cfg => { });

            Assert.IsFalse(configs.IsEmpty);
        }
Exemplo n.º 4
0
        public void Generic_Configure_WhenNeverCalledBefore_ConfigurationIsAdded()
        {
            var configs = new StructureTypeConfigurations();

            configs.Configure <Dummy>(cfg => { });

            Assert.AreEqual(1, configs.Items.Count());
        }
Exemplo n.º 5
0
        public void IsEmpty_WhenSpecificConfigurationExists_ReturnsTrue()
        {
            var configs = new StructureTypeConfigurations();

            configs.Configure <Dummy>(cfg => { });

            Assert.IsFalse(configs.IsEmpty);
        }
        public void Generic_Configure_WhenNeverCalledBefore_ConfigurationIsAdded()
        {
            var configs = new StructureTypeConfigurations();

            configs.Configure<Dummy>(cfg => { });

            Assert.AreEqual(1, configs.Items.Count());
        }
        public void GetConfigurations_WhenRegistreredViaNonGenericVersion_ConfigurationIsReturned()
        {
            var configs = new StructureTypeConfigurations();
            configs.Configure(typeof(Dummy), cfg => { });

            var config = configs.GetConfiguration(typeof(Dummy));

            Assert.IsNotNull(config);
            Assert.AreEqual(typeof(Dummy), config.Type);
        }
Exemplo n.º 8
0
        public void GetConfigurations_WhenRegistreredViaGenericVersion_ConfigurationIsReturned()
        {
            var configs = new StructureTypeConfigurations();

            configs.Configure <Dummy>(cfg => { });

            var config = configs.GetConfiguration(typeof(Dummy));

            Assert.IsNotNull(config);
            Assert.AreEqual(typeof(Dummy), config.Type);
        }