1. <td id="kbyxm"><ruby id="kbyxm"></ruby></td>
    2. <acronym id="kbyxm"></acronym>
      <pre id="kbyxm"></pre>
        <track id="kbyxm"><strike id="kbyxm"></strike></track>
          <tr id="kbyxm"></tr>

        1. <table id="kbyxm"></table>
        2. <acronym id="kbyxm"></acronym>

          C# NUnit單元測試

          C# NUnit單元測試

          1編寫代碼

          namespace ConsoleApplication1 { class NUnitSample { public int Add(int a, int b) { return a + b; } static void Main(string[] args) { NUnitSample sp = new NUnitSample(); Console.WriteLine("writeLine:"+ sp.Add(1, 2)); Console.Read(); } } }

          2添加測試代碼

          using NUnit.Framework; namespace ConsoleApplication1 { [TestFixture] public class NUnitSampleTest { [Test] public void addTest() { NUnitSample sp=new NUnitSample(); int a= sp.Add(1,2); Assert.AreEqual(3, a); } [Test] public void addTest2() { NUnitSample sp = new NUnitSample(); int a = sp.Add(3, 3); Assert.AreEqual(4, a); } } }

          3打開 NUnit

          3.1

          1.PNG

          3.2 新建測試 new

          3.3 導入測試類 打開bin->DeBug->NUnitSampleTest

          4添加測試

          2.PNG

          5完成


          已有 0 條評論

            歡迎您,新朋友,感謝參與互動!
            2020日本三级黄色电影_三级黄色电影在线观看_亚洲bt色图噜一噜色视频_国产av在线网站
            1. <td id="kbyxm"><ruby id="kbyxm"></ruby></td>
            2. <acronym id="kbyxm"></acronym>
              <pre id="kbyxm"></pre>
                <track id="kbyxm"><strike id="kbyxm"></strike></track>
                  <tr id="kbyxm"></tr>

                1. <table id="kbyxm"></table>
                2. <acronym id="kbyxm"></acronym>