• 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
        }
    }

  • 相关阅读:
    solr不是标准的java project解决方案
    solr 索引库的维护
    solr linux配置
    JSON跨域问题总结
    阿里云字体图标的引用
    Android 体系结构
    java.lang.NoClassDefFoundError 异常
    java java.uitl.Random产生随机数
    Android 应用间的集成
    iOS7状态栏字体颜色修改
  • 原文地址:https://www.cnblogs.com/snowball/p/386721.html
Copyright © 2020-2023  润新知