zoukankan      html  css  js  c++  java
  • vs 2005 中的单元测试的生命周期

    // The following code was generated by Microsoft Visual Studio 2005.
    // The test owner should check each test for validity.
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using System;
    using System.Text;
    using System.Collections.Generic;

    namespace TestProject3
    {
        /// <summary>
        ///This is a test class for BankAccountDemo.Business.Tests.BankAccountTest and is intended
        ///to contain all BankAccountDemo.Business.Tests.BankAccountTest Unit Tests
        ///</summary>
        [TestClass()]
        public class LifeLoop
        {
            [TestMethod()]
            public void TestTestMothodBytodd()
            {
                //Assert.Inconclusive("todd.");  4         
                Assert.IsFalse(false);
                //Assert.Fail("dddd");
                Assert.Inconclusive("ddddd");
            }
            [TestMethod()]
            public void TestTestMothodBytodd1()
            {
                //Assert.Inconclusive("todd.");  4         
                Assert.IsFalse(true);
            }
            [ClassInitialize()]
            public static void TestClassInitialize(TestContext testContext)
            {
                //Assert.Inconclusive("ClassInitialize");2
                Assert.IsFalse(false);
               
            }
            [ClassCleanup()]
            public static void TestClassCleanup()
            {
                //Assert.Inconclusive("ClassCleanup");6
                Assert.IsFalse(false);
            }
            [TestInitialize()]
            public void TestTestInitialize()
            {
                //Assert.Inconclusive("TestInitialize");3
                Assert.IsFalse(false);
            }
            [TestCleanup()]
            public  void TestTestCleanup()
            {
                //Assert.Inconclusive("TestCleanup");5
                Assert.IsFalse(false);
            }
            //AssemblyInitialize1
            [AssemblyInitialize()]
            public static void TestAssemblyInitialize(TestContext testContext)
            {
                //Assert.Inconclusive("TestAssemblyInitialize");
                Assert.IsFalse(false);
            }
            //AssemblyCleanup
            [AssemblyCleanup()]
            public static void TestAssemblyCleanup()
            {
                //Assert.Inconclusive("AssemblyCleanup");7
                Assert.IsFalse(false);
            }
            //[Description]
            //public void TestDescription()
            //{
            //    Assert.Inconclusive("Description");
            //}
            [Ignore()]
            public void TestIgnore()
            {
                //Assert.Inconclusive("Ignore");
                Assert.IsFalse(false);
            }
            //1--AssemblyInitialize在执行为执行选择的第一个 TestClass() 中的第一个 TestMethod() 之前
            //2--ClassInitialize带有该属性的方法在执行第一个测试之前调用
            //3--TestInitialize带有该属性的方法在执行每个 TestMethod() 之前调用
            //4--TestMethod该属性表示一个测试用例
            //5--TestCleanup带有该属性的方法在执行每个 TestMethod() 之后调用
            //6--ClassCleanup带有该属性的方法在执行 ALL 测试之后调用
            //7--AssemblyCleanup
        }
    }

  • 相关阅读:
    arc模式和ios的关系
    uitableview置底部,不显示到最顶层
    Mac OS X Lion 10.7.4 升级包
    ObjectiveC urlencode/urldecode url加密解密
    UITableView阴影
    iOS SDK: Working with URL Schemes
    黑苹果mac lion 10.7.3升级10.7.4
    查找 EXC_BAD_ACCESS 问题根源的方法
    "unrecognized selector sent to instance"问题的解决
    测量应用程序cass和cad的使用感受
  • 原文地址:https://www.cnblogs.com/snowball/p/386721.html
Copyright © 2011-2022 走看看