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


C# Test.Abort方法代碼示例

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


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

示例1: BeforeRuns

 public override void BeforeRuns(Test test)
 {
     try
     {
         m_primaryType = test.GetPayloadRootType();
     }
     catch (Exception error)
     {
         test.Abort(this, "Error making ServiceStackTypeSerializer instance in serializer BeforeRun() {0}. \n Did you decorate the primary known type correctly?".Args(error.ToMessageWithType()));
     }
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:11,代碼來源:ServiceStackTypeSerializer.cs

示例2: AssertPayloadEquality

 public override bool AssertPayloadEquality(Test test, object original, object deserialized, bool abort = true)
 {
     string serError = null;
     if (test.Name.Contains("Telemetry"))
     {
         if (!Serbench.Specimens.Tests.TelemetryData.AssertPayloadEquality(original, deserialized, out serError))
         {
             if (abort) test.Abort(this, serError);
             return false;
         }
     }
        else if (test.Name.Contains("EDI_X12_835"))
     {
         if (!Serbench.Specimens.Tests.EDI_X12_835Data.AssertPayloadEquality(original, deserialized, out serError))
         {
             if (abort) test.Abort(this, serError);
             return false;
         }
        }
     return base.AssertPayloadEquality(test, original, deserialized, abort);
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:21,代碼來源:ServiceStackTypeSerializer.cs

示例3: BeforeRuns

 public override void BeforeRuns(Test test)
 {
     try
     {
         m_Serializer = m_KnownTypes==null ? new NetSerializer.Serializer( new Type[]{test.GetPayloadRootType() })
                                           : new NetSerializer.Serializer( new Type[]{test.GetPayloadRootType() }.Concat(m_KnownTypes));
     }
     catch (Exception error)
     {
         test.Abort(this, "Error making NetSerializer instance in serializer BeforeRun() {0}. \n Did you decorate the primary known type correctly?".Args(error.ToMessageWithType()));
     }
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:12,代碼來源:NetSerializerSer.cs

示例4: BeforeRuns

        public override void BeforeRuns(Test test)
        {
            var primaryType = test.GetPayloadRootType();

            try
            {
                m_Serializer = m_KnownTypes.Any() ?
                                new DataContractSerializer(primaryType, m_KnownTypes) :
                                new DataContractSerializer(primaryType);
            }
            catch (Exception error)
            {
                test.Abort(this, "Error making DataContractSerializer instance in serializer BeforeRun() {0}. \n Did you decorate the primary known type correctly?".Args(error.ToMessageWithType()));
            }
        }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:15,代碼來源:MSDataContractSerializer.cs


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