1 using Mola.SCM.Services; 2 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 using System; 4 using System.Collections.Generic; 5 6 namespace Mola.SCM.Tests 7 { 8 9 10 /// <summary> 11 ///这是 DataDifferenceLogBusinessTest 的测试类,旨在 12 ///包含所有 DataDifferenceLogBusinessTest 单元测试 13 ///</summary> 14 [TestClass()] 15 public class DataDifferenceLogBusinessTest 16 { 17 18 19 private TestContext testContextInstance; 20 21 /// <summary> 22 ///获取或设置测试上下文,上下文提供 23 ///有关当前测试运行及其功能的信息。 24 ///</summary> 25 public TestContext TestContext 26 { 27 get 28 { 29 return testContextInstance; 30 } 31 set 32 { 33 testContextInstance = value; 34 } 35 } 36 37 #region 附加测试特性 38 // 39 //编写测试时,还可使用以下特性: 40 // 41 //使用 ClassInitialize 在运行类中的第一个测试前先运行代码 42 //[ClassInitialize()] 43 //public static void MyClassInitialize(TestContext testContext) 44 //{ 45 //} 46 // 47 //使用 ClassCleanup 在运行完类中的所有测试后再运行代码 48 //[ClassCleanup()] 49 //public static void MyClassCleanup() 50 //{ 51 //} 52 // 53 //使用 TestInitialize 在运行每个测试前先运行代码 54 //[TestInitialize()] 55 //public void MyTestInitialize() 56 //{ 57 //} 58 // 59 //使用 TestCleanup 在运行完每个测试后运行代码 60 //[TestCleanup()] 61 //public void MyTestCleanup() 62 //{ 63 //} 64 // 65 #endregion 66 67 68 /// <summary> 69 ///WriteDifferences 的测试 70 ///</summary> 71 public void WriteDifferencesTestHelper<T>() 72 where T : class , new() 73 { 74 DataDifferenceLogBusiness target = new DataDifferenceLogBusiness(); // TODO: 初始化为适当的值 75 IList<T> entities = null; // TODO: 初始化为适当的值 76 string foreignKey = string.Empty; // TODO: 初始化为适当的值 77 object foreignKeyValue = null; // TODO: 初始化为适当的值 78 string creatorCode = string.Empty; // TODO: 初始化为适当的值 79 string creator = string.Empty; // TODO: 初始化为适当的值 80 string remark = string.Empty; // TODO: 初始化为适当的值 81 target.WriteDifferences<T>(entities, foreignKey, foreignKeyValue, creatorCode, creator, remark); 82 Assert.Inconclusive("无法验证不返回值的方法。"); 83 } 84 85 [TestMethod()] 86 public void WriteDifferencesTest() 87 { 88 WriteDifferencesTestHelper<GenericParameterHelper>(); 89 } 90 } 91 }
浙公网安备 33010602011771号