當前位置: 首頁>>代碼示例>>C#>>正文


C# DomainName.Equals方法代碼示例

本文整理匯總了C#中System.DomainName.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# DomainName.Equals方法的具體用法?C# DomainName.Equals怎麽用?C# DomainName.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.DomainName的用法示例。


在下文中一共展示了DomainName.Equals方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DomainName_Unit_Equals3_OtherIsUnequivalentString

        public void DomainName_Unit_Equals3_OtherIsUnequivalentString()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
            String other = new String[] { subDomainLabel, secondLevelLabel, firstLevelLabel }.Join(String.Empty);

            Boolean actual = target.Equals(other);
            Assert.IsFalse(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:11,代碼來源:DomainNameTests.cs

示例2: DomainName_Unit_Equals2_OtherIsUnequivalentDomainName4

        public void DomainName_Unit_Equals2_OtherIsUnequivalentDomainName4()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, "www");
            DomainName other = new DomainName(firstLevelLabel, secondLevelLabel, "deepblue", "something");

            Boolean actual = target.Equals(other);
            Assert.IsFalse(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:10,代碼來源:DomainNameTests.cs

示例3: DomainName_Unit_Equals3_OtherIsNull

        public void DomainName_Unit_Equals3_OtherIsNull()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
            String other = null;

            Boolean actual = target.Equals(other);
            Assert.IsFalse(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:11,代碼來源:DomainNameTests.cs

示例4: DomainName_Unit_Equals2_OtherIsUnequivalentDomainName1

        public void DomainName_Unit_Equals2_OtherIsUnequivalentDomainName1()
        {
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName("com", secondLevelLabel, subDomainLabel);
            DomainName other = new DomainName("net", secondLevelLabel, subDomainLabel);

            Boolean actual = target.Equals(other);
            Assert.IsFalse(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:10,代碼來源:DomainNameTests.cs

示例5: DomainName_Unit_Equals2_OtherIsUnequivalentDomainName2

        public void DomainName_Unit_Equals2_OtherIsUnequivalentDomainName2()
        {
            String firstLevelLabel = "com";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, "vizistata", subDomainLabel);
            DomainName other = new DomainName(firstLevelLabel, "google", subDomainLabel);

            Boolean actual = target.Equals(other);
            Assert.IsFalse(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:10,代碼來源:DomainNameTests.cs

示例6: DomainName_Unit_Equals2_OtherIsSameAsObject

        public void DomainName_Unit_Equals2_OtherIsSameAsObject()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
            DomainName other = target;

            Boolean actual = target.Equals(other);
            Assert.IsTrue(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:11,代碼來源:DomainNameTests.cs

示例7: DomainName_Unit_Equals2_OtherIsEquivalentDomainName

        public void DomainName_Unit_Equals2_OtherIsEquivalentDomainName()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
            DomainName other = new DomainName(firstLevelLabel.ToUpperInvariant(), secondLevelLabel.ToLowerInvariant(), subDomainLabel.ToUpperInvariant());

            Boolean actual = target.Equals(other);
            Assert.IsTrue(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:11,代碼來源:DomainNameTests.cs

示例8: DomainName_Unit_Equals1_ObjIsUnequivalentDomainName4

        public void DomainName_Unit_Equals1_ObjIsUnequivalentDomainName4()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
            String [] subDomainLabels = {"deepblue", "something"};
            Object obj = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabels);

            Boolean actual = target.Equals(obj);
            Assert.IsFalse(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:12,代碼來源:DomainNameTests.cs

示例9: DomainName_Unit_Equals1_ObjIsUnequivalentDomainName2

        public void DomainName_Unit_Equals1_ObjIsUnequivalentDomainName2()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
            secondLevelLabel = "google";
            Object obj = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);

            Boolean actual = target.Equals(obj);
            Assert.IsFalse(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:12,代碼來源:DomainNameTests.cs

示例10: DomainName_Unit_Equals1_ObjIsEquivalentString

        public void DomainName_Unit_Equals1_ObjIsEquivalentString()
        {
            String firstLevelLabel = "com";
            String secondLevelLabel = "vizistata";
            String subDomainLabel = "www";
            DomainName target = new DomainName(firstLevelLabel, secondLevelLabel, subDomainLabel);
            Object obj = new String[] { subDomainLabel, secondLevelLabel, firstLevelLabel }.Join('.');

            Boolean actual = target.Equals(obj);
            Assert.IsTrue(actual);
        }
開發者ID:cegreer,項目名稱:Common,代碼行數:11,代碼來源:DomainNameTests.cs


注:本文中的System.DomainName.Equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。