本文整理匯總了C#中System.Globalization.StringInfo.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# StringInfo.Equals方法的具體用法?C# StringInfo.Equals怎麽用?C# StringInfo.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Globalization.StringInfo
的用法示例。
在下文中一共展示了StringInfo.Equals方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestSameReference
public void TestSameReference()
{
string str = _generator.GetString(-55, false, c_MINI_STRING_LENGTH, c_MAX_STRING_LENGTH);
StringInfo stringInfo1 = new StringInfo(str);
StringInfo stringInfo2 = stringInfo1;
Assert.True(stringInfo1.Equals(stringInfo2));
}
示例2: TestEqualStringInfoWithArg
public void TestEqualStringInfoWithArg()
{
string str = _generator.GetString(-55, false, c_MINI_STRING_LENGTH, c_MAX_STRING_LENGTH);
StringInfo stringInfo1 = new StringInfo(str);
StringInfo stringInfo2 = new StringInfo(str);
Assert.True(stringInfo1.Equals(stringInfo2));
}
示例3: Equals
public void Equals(StringInfo stringInfo, object value, bool expected)
{
Assert.Equal(expected, stringInfo.Equals(value));
if (value is StringInfo)
{
Assert.Equal(expected, stringInfo.GetHashCode().Equals(value.GetHashCode()));
}
}
示例4: TestValueType
public void TestValueType()
{
StringInfo stringInfo1 = new StringInfo("123");
int i = 123;
Assert.False(stringInfo1.Equals(i));
}
示例5: TestNullReference
public void TestNullReference()
{
StringInfo stringInfo1 = new StringInfo("stringinfo1");
object ob = null;
Assert.False(stringInfo1.Equals(ob));
}
示例6: TestDiffType
public void TestDiffType()
{
StringInfo stringInfo1 = new StringInfo("stringinfo1");
string str = "stringinfo1";
Assert.False(stringInfo1.Equals(str));
}
示例7: TestDiffStringInfo
public void TestDiffStringInfo()
{
StringInfo stringInfo1 = new StringInfo("stringinfo1");
StringInfo stringInfo2 = new StringInfo("stringinfo2");
Assert.False(stringInfo1.Equals(stringInfo2));
}
示例8: TestEqualStringInfoWithNoArg
public void TestEqualStringInfoWithNoArg()
{
StringInfo stringInfo1 = new StringInfo();
StringInfo stringInfo2 = new StringInfo();
Assert.True(stringInfo1.Equals(stringInfo2));
}