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


C# AssetBase.ToString方法代碼示例

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


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

示例1: AsssetBaseConstructorTest01

        public void AsssetBaseConstructorTest01()
        {
            AssetBase abase = new AssetBase();
            Assert.IsNotNull(abase.Metadata, "void constructor of AssetBase should have created a MetaData element but didn't.");
            UUID itemID = UUID.Random();
            UUID creatorID = UUID.Random();
            abase = new AssetBase(itemID.ToString(), "test item", (sbyte) AssetType.Texture, creatorID.ToString());

            Assert.IsNotNull(abase.Metadata, "string,string,sbyte,string constructor of AssetBase should have created a MetaData element but didn't.");
            Assert.That(abase.ID == itemID.ToString(), "string,string,sbyte,string constructor failed to set ID property");
            Assert.That(abase.Metadata.CreatorID == creatorID.ToString(), "string,string,sbyte,string constructor failed to set Creator ID");


            abase = new AssetBase(itemID.ToString(), "test item", -1, creatorID.ToString());
            Assert.IsNotNull(abase.Metadata, "string,string,sbyte,string constructor of AssetBase with unknown type should have created a MetaData element but didn't.");
            Assert.That(abase.Metadata.Type == -1, "Unknown Type passed to string,string,sbyte,string constructor and was a known type when it came out again");

            AssetMetadata metts = new AssetMetadata();
            metts.FullID = itemID;
            metts.ID = string.Empty;
            metts.Name = "test item";
            abase.Metadata = metts;

            Assert.That(abase.ToString() == itemID.ToString(), "ToString is overriden to be fullID.ToString()");
            Assert.That(abase.ID == itemID.ToString(),"ID should be MetaData.FullID.ToString() when string.empty or null is provided to the ID property");
        }
開發者ID:justasabc,項目名稱:opensim75grid,代碼行數:26,代碼來源:MundaneFrameworkTests.cs


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