??????????????????????????????????????InitTestInstance???÷???????????????????????????У????????????????????鵱????????????е????
????this.CheckCurrentTestCaseIsRun(this.serviceInstance);//check current test case .??????????????С?
1 using System;
2 using Microsoft.VisualStudio.TestTools.UnitTesting;
3
4 namespace OrderManager.Test
5 {
6     public abstract class ProductServiceIntegrationBase
7     {
8         /// <summary>
9         /// service address.
10         /// </summary>
11         protected const string ServiceAddressForDev = "http://dev.service.ProductService/";
12
13         /// <summary>
14         /// get service address.
15         /// </summary>
16         protected const string ServiceAddressForPrd = "http://Prd.service.ProductService/";
17
18         /// <summary>
19         /// service address.
20         /// </summary>
21         protected const string ServiceAddressTest = "http://Test.service.ProductService/";
22
23         /// <summary>
24         /// Test context .
25         /// </summary>
26         public TestContext TestContext { get; set; }
27
28         /// <summary>
29         /// is check is run for current test case.
30         /// </summary>
31         protected void CheckCurrentTestCaseIsRun(ProductService.Contract.ProductServiceClient testObject)
32         {
33             if (testObject.ServiceAddress.Equals(ServiceAddressForPrd))// Prd ?????????С????
34             {
35                 if (this.TestContext.TestName.Equals("ProductService_DeleteProductSearchIndex_Test"))
36                     Assert.IsTrue(false?? "????????????????????PRD??????????????????С?");
37             }
38             else if (testObject.ServiceAddress.Equals(ServiceAddressTest))//Test ????????????????????
39             {
40                 if (this.TestContext.TestName.Equals("ProductService_DeleteProductSearchIndex_Test"))
41                     Assert.IsTrue(false?? "????????????????????TEST?????????TEST???????????????????С?");
42             }
43         }
44     }
45 }
???????鷽??????????ü????ж???????????????PRD??TEST????????У?????ж??е??????????????????????????????????????????????????????е????????????????????

?????????????????????????????????????????????С??????????12??????????????????????????????????鵼?μ???????д??????????????????????????????