• 課程時長

    28 小時 45 分

  • 課程級別

    初級

  • 授課語言

    中文

這堂課你將會學到

  • MSTest 和 NUnit 的差異和比較
  • AAA (Arrange, Act, Assert) pattern
  • 在 Visual Studio 的 Test Explorer 視窗使用 NUnit 語法和 MSTest 語法的 Group 和 Filter
  • 針對 MSTest 語法介紹 Exception、order list、generic test 觀念
  • 討論 MSTest 語法和 NUnit 語法下的 TestContext 和 System.Diagnostics.Debug 的差異和比較
  • MSTest 語法和 NUnit 語法針對 Data Driven 觀念的差異和比較
  • MSTest 語法和 NUnit 語法的 Test Execution Life Cycle 觀念
  • 使用 command line 來執行 NUnit 語法和 MSTest 語法所寫成的單元測試
  • 徹底了解 MSTest 語法和 NUnit 語法的 Assertion 精華差異比較
  • Test Driven Development (TDD) 的 Red Green Refactor 流程
  • Test Driven Development (TDD) 的 Facking、Red、Green、Triangulation Refactor、Obvious Implementation 流程

章節目錄

  • 1

    第 1 章 IT工具人學院

    • 單元 1 - 課程使用方法

    • 單元 2 - ITHandyGuy粉絲團

  • 2

    第 2 章 關於本課程

    • 單元 1 - 本課程講義目錄

    • 單元 2 - 本課程導讀

    • 單元 3 - 本課程導讀

  • 3

    第 3 章 關於Test學程 (.NET Framework的子學程)

    • 單元 1 - TestSeries Preview01 - 關於測試

    • 單元 2 - TestSeries Preview01 - 關於測試

    • 單元 3 - TestSeries Preview02 - 關於單元測試 V.S. 整合測試 V.S. 端對端測試

    • 單元 4 - TestSeries Preview02 - 關於單元測試 V.S. 整合測試 V.S. 端對端測試

    • 單元 5 - TestSeries Preview03 - 關於測試學程

    • 單元 6 - TestSeries Preview03 - 關於測試學程

  • 4

    第 4 章 工具下載與安裝

    • 單元 1 - 工具下載與安裝

    • 單元 2 - 工具下載與安裝

    • 單元 3 - Visual Studio 2017下載安裝說明

    • 單元 4 - Visual Studio 2017下載安裝說明

    • 單元 5 - SQL Server 2019下載與安裝

    • 單元 6 - SQL Server 2019下載與安裝

    • 單元 7 - Visual Studio 2019下載與安裝

    • 單元 8 - Visual Studio 2019下載與安裝

    • 單元 9 - NUnit3TestAdapter下載與安裝(VS2019)

    • 單元 10 - NUnit3TestAdapter下載與安裝(VS2019)

  • 5

    第 5 章 MSTest和NUnit的基礎觀念 (課程從這開始)

    • 單元 1 - Tutorial 01講義: NUnit的基本觀念

    • 單元 2 - Tutorial 01-01: 基本觀念介紹,安裝NUnit 3 Test Adapter

    • 單元 3 - Tutorial 01-02: 寫一個簡單的Code,和實作簡單Ui

    • 單元 4 - Tutorial 01-03: 用NUnit來寫Test

    • 單元 5 - Tutorial 01-04: 用MSTest來寫Test

    • 單元 6 - Tutorial 02講義: 使用自動生成器生成單元測試並且Debug。

    • 單元 7 - Tutorial 02-01: 自動生成MSTest

    • 單元 8 - Tutorial 02-02: 如何Debug Unit Test

    • 單元 9 - Tutorial 02-03: 使用NUnit重構

  • 6

    第 6 章 MSTest和NUnit的Trait

    • 單元 1 - Tutorial03講義: 關於Test Explorer的Grouping和Filtering

    • 單元 2 - Tutorial 03-01: MSTest的Grouping和Filtering

    • 單元 3 - Tutorial 03-02: NUnit的Grouping和Filtering

  • 7

    第 7 章 MSTest的觀念

    • 單元 1 - Tutorial04講義: 使用VS2013Pro了解Code Coverage。Private Method的單元測試。關於Test Exception、Order Tests、Generic Test。使用command line跑MSTest。

    • 單元 2 - Tutorial 04-01: 寫一些Code

    • 單元 3 - Tutorial 04-02: 寫MSTest

    • 單元 4 - Tutorial 04-03: 討論Code Coverage

    • 單元 5 - Tutorial 04-04: 測試Exception

    • 單元 6 - Tutorial 04-05: 測試Private Method

    • 單元 7 - Tutorial 04-06: 使用Ordered Tests

    • 單元 8 - Tutorial 04-07: 使用Generic Tests

    • 單元 9 - Tutorial 04-08: 使用command line跑MSTest

  • 8

    第 8 章 TestContext V.S System.Diagnostics.Debug

    • 單元 1 - Tutorial05講義: 關於TestContext.WriteLine V.S. System.Diagnostics.Debug.WriteLine

    • 單元 2 - Tutorial 05-01: 在VS2013Pro使用TestContextWriteLine和SystemDiagnosticsDebugWriteLine

    • 單元 3 - Tutorial 05-02: 在VS2017Community使用MSTest了解TestContextWriteLine和SystemDiagonsticsDebugWriteLIne

    • 單元 4 - Tutorial 05-03: 在VS2017Community使用NUnit了解TestContextWriteLine和SystemDiagnosticsDebugWriteLine

  • 9

    第 9 章 MSTest和NUnit的Data Driven觀念

    • 單元 1 - Tutorial 06講義: 關於Yield Return

    • 單元 2 - Tutorial 06-01: Yield Return的Filter Sample

    • 單元 3 - Tutorial 06-02: Yield Return的Total Sample

    • 單元 4 - Tutorial 07講義: 讀取CSV

    • 單元 5 - Tutorial 07-01: 一些設定

    • 單元 6 - Tutorial 07-02: 讀取CSV

    • 單元 7 - Tutorial 07-03: 讀取CSV,遇到exception就跳過。

    • 單元 8 - Tutorial 07-04: 讀取CSV,使用yield return。

    • 單元 9 - Tutorial 07-05: 讀取CSV,使用yield return,遇到exception就跳過。

    • 單元 10 - Tutorial 07-06: 使用LumenWorksCsvReader讀取CSV

    • 單元 11 - Tutorial 07-07: 使用LumenWorksCsvReader讀取CSV,遇到exception就跳過。

    • 單元 12 - Tutorial 07-08: 使用LumenWorksCsvReader讀取CSV,使用yield return。

    • 單元 13 - Tutorial 07-09: 使用LumenWorksCsvReader讀取CSV,使用yield return,遇到exception就跳過。

    • 單元 14 - Tutorial 07-10: 使用Linq讀取CSV

    • 單元 15 - Tutorial 07-11: 使用Linq讀取CSV,遇到exception就跳過。

    • 單元 16 - Tutorial 07-12: 使用Linq讀取CSV,使用yield return。

    • 單元 17 - Tutorial 07-13: 使用Linq讀取CSV,使用yield return,遇到exception就跳過。

    • 單元 18 - Tutorial 08講義: 讀取Xml

    • 單元 19 - Tutorial 08-01: 一些設定

    • 單元 20 - Tutorial 08-02: 使用Linq讀取Xml並搭配Where、OrderBy、Let

    • 單元 21 - Tutorial 08-03: 使用Linq讀取Xml

    • 單元 22 - Tutorial 08-04: 使用Linq讀取Xml,遇到exception就跳過。

    • 單元 23 - Tutorial 08-05: 使用Linq讀取Xml,使用yield return。

    • 單元 24 - Tutorial 08-06: 使用Linq讀取Xml,使用yield return,遇到exception就跳過。

    • 單元 25 - Tutorial 09講義: 使用EntityFrameworkCodeFirst讀取Sql

    • 單元 26 - Tutorial 09: 使用EntityFrameworkCodeFirst讀取Sql

    • 單元 27 - Tutorial10講義: 關於MSTest的DataSourceAttibute,測試xml、CSV、sqlServer的Data

    • 單元 28 - Tutorial 10-01: 準備好database

    • 單元 29 - Tutorial 10-02: 在VS2017Community和VS2013Pro加入MSTest Project

    • 單元 30 - Tutorial 10-03: 準備好XML和CSV

    • 單元 31 - Tutorial 10-04: 使用MSTest測試SQLServer、XML、CSV裡面的Data

    • 單元 32 - Tutorial 10-05: 使用MSTest並設定App.config測試SQLServer、XML、CSV裡面的Data

    • 單元 33 - Tutorial11講義: 關於NUnit的TestCaseSourceAttibute和MSTest的DataSourceAttibute,測試xml、CSV、sqlServer的Data

    • 單元 34 - Tutorial 11-01: 準備好database

    • 單元 35 - Tutorial 11-02: 在VS2017Community做前置準備,建立xml和csv範例。

    • 單元 36 - Tutorial 11-03: 複習MSTest的DataSourceAttibute測試SQLServer、XML、CSV裡面的Data

    • 單元 37 - Tutorial 11-04: 使用EntityFrameworkCodeFirst讀取Sql Server data

    • 單元 38 - Tutorial 11-05: NUnit前置準備

    • 單元 39 - Tutorial 11-06-01: 關於TestCase

    • 單元 40 - Tutorial 11-06-02: 關於TestCaseSource測試GlobalVariable

    • 單元 41 - Tutorial 11-06-03: 關於TestCaseSource測試有參數的Method

    • 單元 42 - Tutorial 11-06-04: 關於TestCaseSource測試其他class的Method

    • 單元 43 - Tutorial 11-06-05: 關於TestCaseSource測試有實作IEnumerable的Class

    • 單元 44 - Tutorial 11-06-06: 關於TestCaseSource測試其他class

    • 單元 45 - Tutorial 11-06-07: 關於TestCaseSource測試有和沒有Yield Return的其他class的method

    • 單元 46 - Tutorial 11-07: NUnit使用TestCaseSourceAttribute去抓IEnumerableT當來源。

    • 單元 47 - Tutorial 11-08-01: NUnit使用TestCaseSourceAttribute測試Csv data

    • 單元 48 - Tutorial 11-08-02: NUnit使用TestCaseSourceAttribute測試Csv data搭配Yield Return

    • 單元 49 - Tutorial 11-09: NUnit使用TestCaseSourceAttribute測試Xml data

    • 單元 50 - Tutorial 11-10: NUnit使用TestCaseSourceAttribute搭配EF測試Sql database server data

  • 10

    第 10 章 關於Test Execution Life Cycle

    • 單元 1 - Tutorial 12講義: 關於MSTest的TestInitialize,TestCleanup,ClassInitialize,ClassCleanup,AssemblyInitialize,AssemblyCleanup

    • 單元 2 - Tutorial12-01: 關於MSTest的TestInitialize,TestCleanup,ClassInitialize,ClassCleanup,AssemblyInitialize,AssemblyCleanup

    • 單元 3 - Tutorial12-02: 關於MSTest的TestInitialize和ClassInitialize中的變數存活

    • 單元 4 - Tutorial 13講義: 關於TestExecutionLifeCycle和Output

    • 單元 5 - Tutorial13-01: 前置準備

    • 單元 6 - Tutorial13-02: 關於MSTest的TestClass的TestInitialize和TestCleanup搭配Output用法和限制。

    • 單元 7 - Tutorial13-03: 關於MSTest的TestClass的ClassInitialize和ClassCleanup搭配Output用法和限制。

    • 單元 8 - Tutorial13-04: 關於MSTest的TestClass的AssemblyInitialize和AssemblyCleanup搭配

    • 單元 9 - Tutorial13-05: 關於NUnit的TestFixture的SetUp和TearDown搭配Output用法和限制。

    • 單元 10 - Tutorial13-06: 關於NUnit的TestFixture的OneTimeSetUp和OneTimeTearDown搭配Output用法和限制。

    • 單元 11 - Tutorial13-07: 關於NUnit的SetUpFixture的OneTimeSetUp和OneTimeTearDown搭配Output用法和限制。

    • 單元 12 - Tutorial13-08: 觀念總結

    • 單元 13 - Tutorial13-09: ConsoleWriteline和output的補充。

    • 單元 14 - Tutorial 14講義: 關於TimeOut Attribute和Ignore Attribute

    • 單元 15 - Tutorial14-01: 關於MSTest的TimeOut Attribute和Ignore Attribute

    • 單元 16 - Tutorial14-02: 關於NUnit的TimeOut Attribute和Ignore Attribute

    • 單元 17 - Tutorial 15講義: 關於Sorting Test

    • 單元 18 - Tutorial 15-01: 前置作業

    • 單元 19 - Tutorial 15-02: 用NUnit的Order來Sorting Test

    • 單元 20 - Tutorial 15-03: 用MSTest沒太多選擇。透過Merge Tests來Sorting。

    • 單元 21 - Tutorial 15-04: 觀念總結

  • 11

    第 11 章 使用Command Line跑Test

    • 單元 1 - Tutorial 16講義: 在VS2017使用Command Line跑MSTest和NUnit

    • 單元 2 - Tutorial 16-01: 前置作業

    • 單元 3 - Tutorial 16-02: 複習MSTest的Traits

    • 單元 4 - Tutorial 16-03: 在VS2017使用Command Line跑MSTest

    • 單元 5 - Tutorial 16-04: 複習NUnit的Traits

    • 單元 6 - Tutorial 16-05: 在VS2017使用Command Line跑NUnit

  • 12

    第 12 章 徹底解析大魔王Assert

    • 單元 1 - Tutorial 17講義: 關於override Equals和GetHashCode。並且比較實作IComparer的Compare

    • 單元 2 - Tutorial 17-01: 理解Equals, GetHashCode

    • 單元 3 - Tutorial 17-02: 理解IComparer, Compare

    • 單元 4 - Tutorial 17-03: 討論等等用來測試的Mathematics Class

    • 單元 5 - Tutorial 18講義: 關於StringAssert底下的StartsWith, EndsWith, Contains, Matches, DoesNotMatch

    • 單元 6 - Tutorial 18-01: 使用MSTest, 關於StringAssert底下的StartsWith, EndsWith, Contains, Matches, DoesNotMatch

    • 單元 7 - Tutorial 18-02: 使用NUnit, 關於StringAssert底下的StartsWith, EndsWith, Contains, Matches,DoesNotMatch

    • 單元 8 - Tutorial 19講義: 關於Assert的Faill和InConclusive和Warn

    • 單元 9 - Tutorial 19-01: 使用MSTest關於Assert的Faill, InConclusive

    • 單元 10 - Tutorial 19-02: 使用NUnit關於Assert的Faill, InConclusive, Warn

    • 單元 11 - Tutorial 20講義: 關於AssertIs, 包括IsTrue, IsFalse_IsNull_IsNotNull_IsInstanceOf_IsNotInstanceOf

    • 單元 12 - Tutorial 20-01: 使用MSTest關於Assert的IsTrue, IsFalse, IsNull, IsNotNull, IsInstanceOfType,IsNotInstanceOfType

    • 單元 13 - Tutorial 20-02: 使用NUnit關於Assert的IsTrue, IsFalse, IsNull, IsNotNull, IsInstanceOf

    • 單元 14 - Tutorial 21講義: 關於AssertSingleObject, 包括AreEqual, AreSame, AreNotEqual, AreNotSame

    • 單元 15 - Tutorial 21-01: 使用MSTest關於Assert Value Type, 包括AreEqual, AreSame, AreNotEqual, AreNotSame

    • 單元 16 - Tutorial 21-02: 使用MSTest關於Assert ComplexType, 包括AreEqual, AreSame, AreNotEqual, AreNotSame

    • 單元 17 - Tutorial 21-03: 使用NUnit關於Assert Value Type, 包括AreEqual, AreSame, AreNotSame

    • 單元 18 - Tutorial 21-04: 使用NUnit關於Assert Complex Type, 包括AreEqual, AreSame, AreNotSame

    • 單元 19 - Tutorial 22講義: 關於Assert Collection

    • 單元 20 - Tutorial 22-01: 使用MSTest關於Assert Value Type Collection

    • 單元 21 - Tutorial 22-02: 使用MSTest關於Assert ComplexType Collection

    • 單元 22 - Tutorial 22-03: 使用NUnit關於Assert Value Type Collection

    • 單元 23 - Tutorial 22-04: 使用NUnit關於Assert Complex Type Collection

    • 單元 24 - Tutorial 23講義: 關於AssertThat基本語法

    • 單元 25 - Tutorial 23-01: 關於MSTest的Assert.That

    • 單元 26 - Tutorial 23-02: 關於NUnit的Assert.That的All

    • 單元 27 - Tutorial 23-03: 關於NUnit的Assert.That的Not

    • 單元 28 - Tutorial 23-04: 關於NUnit的Assert.That的Does

    • 單元 29 - Tutorial 23-05: 關於NUnit的Assert.That的Has

    • 單元 30 - Tutorial 23-06: 關於NUnit的Assert.That的Or和And

    • 單元 31 - Tutorial 24講義: 關於AssertThat針對ValueType基本語法

    • 單元 32 - Tutorial 24-01: 關於NUnit的Assert.That的String

    • 單元 33 - Tutorial 24-02: 關於NUnit的Assert.That的Numerical

    • 單元 34 - Tutorial 24-03: 關於NUnit的Assert.That的Null

    • 單元 35 - Tutorial 24-04: 關於NUnit的Assert.That的Bool

    • 單元 36 - Tutorial 24-05: 關於NUnit的Assert.That的Range

    • 單元 37 - Tutorial 25講義: 關於AssertThat針對SingleComplexType基本語法

    • 單元 38 - Tutorial 25: 關於AssertThat針對SingleComplexType基本語法

    • 單元 39 - Tutorial 26講義: 關於AssertThat針對Collection基本語法

    • 單元 40 - Tutorial 26-01: 關於NUnit的Assert.That的StringArray

    • 單元 41 - Tutorial 26-02: 關於NUnit的Assert.That的StringCollection

    • 單元 42 - Tutorial 26-03: 關於NUnit的Assert.That的IntCollection

    • 單元 43 - Tutorial 26-04: 關於NUnit的Assert.That的ComplexObjectsCollection搭配IComparer

    • 單元 44 - Tutorial 26-05: 關於NUnit的Assert.That的ComplexObjectsCollection

    • 單元 45 - Tutorial 27講義: 關於AssertThat針對MultipleAssert基本語法

    • 單元 46 - Tutorial 27: 關於AssertThat針對MultipleAssert基本語法

    • 單元 47 - Tutorial 28講義: 關於Assert針對Exception的基本語法

    • 單元 48 - Tutorial 28-01: 關於MSTest的ExpectedException

    • 單元 49 - Tutorial 28-02: 關於NUnit的Assert.Throws

    • 單元 50 - Tutorial 29講義: 關於ParameterizedTests, 介紹NUnit的TestCase基本語法

    • 單元 51 - Tutorial 29-01: 關於NUnit的TestCase

    • 單元 52 - Tutorial 29-02: 關於MSTest的BigTestMethod

  • 13

    第 13 章 關於Test Driven Development (TDD)

    • 單元 1 - Tutorial 30講義: 關於Test Driven Development (TDD), Red Green Refactor

    • 單元 2 - Tutorial 30: 關於Test Driven Development (TDD), Red Green Refactor

    • 單元 3 - Tutorial 31講義: 關於TDD的Facking, Red, Green, Triangulation Refactor, Obvious Implementation範例

    • 單元 4 - Tutorial 31: 關於TDD的Facking, Red, Green, Triangulation Refactor, Obvious Implementation範例