zoukankan      html  css  js  c++  java
  • Nuint-测试执行逻辑

    Nuint-

    using System;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using NUnit.Framework;
    namespace NC_Test._002Nc_Alac
    {
        [TestFixture]
        public class Alac_Test01
        {
            String sIP = "192.168.1.1";
    
            [TestMethod]
            public void TestMethod1()
            {
                Console.WriteLine(111);
            }
            [TestFixtureSetUp]
            public void Teststat()
            {
                Console.WriteLine("(初始化)方法TestFixtureSetUp");
            }
            [SetUp]
            public void TestSetup()
            {
                Console.WriteLine("每次执行方法SetUp");
            }
        
            [Test]
            public void Channe()
            {
    
                Console.WriteLine("ip={0}", sIP);
    
                NUnit.Framework.Assert.AreEqual(2, 2);
                NUnit.Framework.Assert.AreEqual(1, 2);
            }
            [Test]
            public void Channe2()
            {
    
                Console.WriteLine("ip={0}", sIP);
    
                NUnit.Framework.Assert.AreEqual(2, 2);
                NUnit.Framework.Assert.AreEqual(1, 2);
            }
           [TearDown]
            public void jsRepat()
            {
                Console.WriteLine("结束运行TearDown");
    
            }
            [TestFixtureTearDown]
            public void js()
            {
                Console.WriteLine("结束运行TestFixtureTearDown");
    
            }
        }
    }

    执行结果

    (初始化)方法TestFixtureSetUp
    ***** NC_Test._002Nc_Alac.Alac_Test01.Channe
    每次执行方法SetUp
    ip=192.168.1.1
    结束运行TearDown
    ***** NC_Test._002Nc_Alac.Alac_Test01.Channe2
    每次执行方法SetUp
    ip=192.168.1.1
    结束运行TearDown
    结束运行TestFixtureTearDown
  • 相关阅读:
    洛谷 P1037 产生数
    【bzoj】 1070: [SCOI2007]修车
    【bzoj】 1066: [SCOI2007]蜥蜴 (网络流)
    开发环境搭建
    数据库设计
    sql优化实例(用左连接)
    泛型T和通配符?的区别
    Nginx配置优化
    Tomcat优化
    Nginx反向代理配置
  • 原文地址:https://www.cnblogs.com/hs22/p/7208616.html
Copyright © 2011-2022 走看看