当前位置: 首页>>代码示例>>C#>>正文


C# Configuration.Equals方法代码示例

本文整理汇总了C#中Configuration.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Configuration.Equals方法的具体用法?C# Configuration.Equals怎么用?C# Configuration.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configuration的用法示例。


在下文中一共展示了Configuration.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShouldBeEqualToAnotherConfigurationIfItHasTheSameFullNameAndValue

        public void ShouldBeEqualToAnotherConfigurationIfItHasTheSameFullNameAndValue()
        {
            var connections = new Configuration("connections");
            var database1 = new Configuration("database", "localhost", c => c.BelongingTo(connections));
            var database2 = new Configuration("database", "localhost", c => c.BelongingTo(connections));

            Assert.IsTrue(database2.Equals(database1));
            Assert.IsTrue(database1.Equals(database2));
        }
开发者ID:MACSkeptic,项目名称:ExpLorer,代码行数:9,代码来源:ConfigurationTest.cs

示例2: ShouldNotBeEqualToAnotherConfigurationIfDoesNotHaveTheSameFullNameAndValue

        public void ShouldNotBeEqualToAnotherConfigurationIfDoesNotHaveTheSameFullNameAndValue()
        {
            var connections = new Configuration("connections");
            var infrastructure = new Configuration("infrastructure");
            var database1 = new Configuration("database", "localhost", c => c.BelongingTo(connections));
            var database2 = new Configuration("database", "localhost", c => c.BelongingTo(infrastructure));
            var database3 = new Configuration("database", "remotehost", c => c.BelongingTo(connections));
            var database4 = new Configuration("databases", "localhost", c => c.BelongingTo(infrastructure));

            Assert.IsFalse(database2.Equals(database1));
            Assert.IsFalse(database1.Equals(database2));
            Assert.IsFalse(database2.Equals(database3));
            Assert.IsFalse(database1.Equals(database3));
            Assert.IsFalse(database2.Equals(database4));
            Assert.IsFalse(database1.Equals(database4));
            Assert.IsFalse(database3.Equals(database1));
            Assert.IsFalse(database3.Equals(database2));
            Assert.IsFalse(database4.Equals(database1));
            Assert.IsFalse(database4.Equals(database2));
        }
开发者ID:MACSkeptic,项目名称:ExpLorer,代码行数:20,代码来源:ConfigurationTest.cs

示例3: getSimilarConfig

        private static Tuple<Configuration, Configuration> getSimilarConfig(Configuration config)
        {
            Configuration similarConfig = null;
            List<Configuration> similarOnes = new List<Configuration>();
            int nbCount = config.BinaryOptions.Count;
            if (config.BinaryOptions.Keys.Contains(varModel.Root))
                nbCount--;
            bool found = false;
            foreach (var configInGS in GlobalState.allMeasurements.getSimilarConfigs(config))
            {
                if (config.Equals(configInGS))
                {
                    similarConfig = configInGS;
                    found = true;
                    break;
                }
                else if (takeSimilarConfig)
                {
                    var conf = findSimilarConfigBinary(config, configInGS, nbCount);
                    if (conf != null)
                        similarOnes.Add(conf);
                }
            }
            if (!found)
            {
                if (takeSimilarConfig && similarOnes.Count > 0)
                    similarConfig = findSimilarConfigNumeric(config, similarOnes);
                else
                {
                    if (similarOnes.Count == 0)
                        logError.logLine("Required config: " + config.ToString() + " " + config.printConfigurationForMeasurement());

                    // logError.log("Did not find a measured value for the configuration: " + config.ToString());
                }
            }

            return Tuple.Create<Configuration, Configuration>(config, similarConfig);
        }
开发者ID:ChristianKapfhammer,项目名称:SPLConqueror,代码行数:38,代码来源:GlobalState.cs


注:本文中的Configuration.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。