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
  • 相关阅读:
    jquery UI_tabs
    乔布斯传
    微信小程序
    天气预报相关参数
    ASP.NET MVC TempData使用心得
    jquery.restrictFieldLength.js
    join Linq
    SQL_关联映射
    介绍几个好用的vs插件
    DependencyResolver.Current
  • 原文地址:https://www.cnblogs.com/hs22/p/7208616.html
Copyright © 2011-2022 走看看