本文整理汇总了C#中Realm.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Realm.ToString方法的具体用法?C# Realm.ToString怎么用?C# Realm.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Realm
的用法示例。
在下文中一共展示了Realm.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EqualsTest
public void EqualsTest()
{
Realm tr1a = new Realm("http://www.yahoo.com");
Realm tr1b = new Realm("http://www.yahoo.com");
Realm tr2 = new Realm("http://www.yahoo.com/b");
Realm tr3 = new Realm("http://*.www.yahoo.com");
Assert.AreEqual(tr1a, tr1b);
Assert.AreNotEqual(tr1a, tr2);
Assert.AreNotEqual(tr1a, null);
Assert.AreNotEqual(tr1a, tr1a.ToString(), "Although the URLs are equal, different object types shouldn't be equal.");
Assert.AreNotEqual(tr3, tr1a, "Wildcard difference ignored by Equals");
}
示例2: GetRealmBaseUrl
private static string GetRealmBaseUrl(Realm realm)
{
string rlm = string.Empty;
if (realm != Realm.People)
{
rlm = realm.ToString().ToLower() + "/";
}
string url = string.Empty;
switch (ConfigUtil.GetAppSetting("Application.Environment"))
{
case "local":
url = "http://" + ChurchCode + ".fellowshiponeapi.local/" + rlm + Version;
break;
case "development":
url = "http://" + ChurchCode + ".api.dev.corp.local/" + rlm + Version;
break;
case "integration":
url = "http://" + ChurchCode + ".apiqa.dev.corp.local/" + rlm + Version;
break;
case "staging":
url = "https://" + ChurchCode + ".staging.fellowshiponeapi.com/" + rlm + Version;
break;
case "production":
url = "https://" + ChurchCode + ".fellowshiponeapi.com/" + rlm + Version;
break;
default:
url = "http://" + ChurchCode + ".fellowshiponeapi.local/" + rlm + Version;
break;
}
return url;
}