• 課程時長

    23 小時 43 分

  • 課程級別

    初級

  • 授課語言

    中文

這堂課你將會學到

  • Test Double 觀念,並了解 Dummy、Stub、Spy、Mock 和 Fake 的異同
  • 了解什麼是過度使用 Test Double 和不必要的 Code Coverage
  • 如何用 Mocking Framework 來動態生成 Test Double
  • 理解 Moq 語法和 NSubstitute 語法的差異與比較
  • 認識 Property 和 Void Method 的 Mocking
  • Mocking Framework 的重要觀念:Verify、Callback、Mock Repository
  • 認識數個常用的 Mock Behavior,不再成為雷隊友
  • 對 Integration Test 來說很重要的 Compare 和 Equal相關的 Interface 搭配 Assert 以及 Collection Assert 的關係

章節目錄

  • 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 章 關於Test Double (課程從這開始)

    • 單元 1 - Tutorial 32講義: 關於TestDouble

    • 單元 2 - Tutorial 32-01: 關於TestDouble

    • 單元 3 - Tutorial 32-02: 可單元測試的code

    • 單元 4 - Tutorial 32-03: 關於Dummy

    • 單元 5 - Tutorial 32-04: 關於Stub

    • 單元 6 - Tutorial 32-05: 關於Spy

    • 單元 7 - Tutorial 32-06: 關於Mock

    • 單元 8 - Tutorial 32-07: 關於Fake

    • 單元 9 - Tutorial 32-08: 不能單元測試的code

    • 單元 10 - Tutorial 32-09-01: 關於Mocking Framework, NSubstitute生成Fake

    • 單元 11 - Tutorial 32-09-02: 關於Mocking Framework, NSubstitute生成Dummy

    • 單元 12 - Tutorial 32-10: 關於Mocking Framework, Moq

    • 單元 13 - Tutorial 32-11: 關於Resharper的CoverCoverage

    • 單元 14 - Tutorial 33講義: 關於過度使用Test Double和不必要的Code Coverage

    • 單元 15 - Tutorial 33-01: 不必要的Code Coverage的範例準備

    • 單元 16 - Tutorial 33-02: 不必要的Code Coverage範例

    • 單元 17 - Tutorial 33-03: 過度使用Test Double的範例準備

    • 單元 18 - Tutorial 33-04: 過度使用Test Double, 用Moq來實作Property和voidMethod

    • 單元 19 - Tutorial 33-05: 過度使用Test Double, 用NSubstitute來實作Property

  • 6

    第 6 章 關於Mocking Framework

    • 單元 1 - Tutorial 34講義: 關於Mocking Framework : 前置準備

    • 單元 2 - Tutorial 34-01: 關於Mocking Framework : 前置準備,寫Interface

    • 單元 4 - Tutorial 35講義: 關於Mock Method和Exception

    • 單元 3 - Tutorial 34-02: 關於Mocking Framework : 前置準備,寫Class

    • 單元 5 - Tutorial 35-01: 關於Mock普通的Method

    • 單元 6 - Tutorial 35-02-01: 關於Mock有Argument Matching的Method,使用Moq

    • 單元 7 - Tutorial 35-02-02: 關於Mock有Argument Matching的Method,使用NSubstitute

    • 單元 8 - Tutorial 35-03-01: 關於Mock有Out Parameter的Method, 使用Moq

    • 單元 9 - Tutorial 35-03-02: 關於Mock有Out Parameter的Method, 使用NSubstitute

    • 單元 10 - Tutorial 35-04-01: 關於Mock有Ref Parameter的Method, 使用Moq

    • 單元 11 - Tutorial 35-04-02: 關於Mock有Ref Parameter的Method, 使用NSubstitute

    • 單元 12 - Tutorial 35-05-01: 關於Mock有Any Value Argument的Method, 使用Moq

    • 單元 13 - Tutorial 35-05-02: 關於Mock有Any Value Argument的Method, 使用NSubstitute

    • 單元 14 - Tutorial 35-06-01: 關於Mock有Callback的Method, 使用Moq

    • 單元 15 - Tutorial 35-06-02: 關於Mock有Callback的Method, 使用NSubstitute

    • 單元 16 - Tutorial 35-07-01: 關於Mock有Throw Exception的Method , 使用Moq

    • 單元 17 - Tutorial 35-07-02: 關於Mock有Throw Exception的Method, 使用NSubstitute

    • 單元 18 - Tutorial 36講義: 關於Mock Property和Void Method

    • 單元 19 - Tutorial 36-01: 關於Mock普通的Property和Void Method, 使用Moq

    • 單元 20 - Tutorial 36-02: 關於Mock普通的Property和Void Method, 使用NSubstitute

    • 單元 21 - Tutorial 36-03: 關於Mock Property的property, 使用Moq

    • 單元 22 - Tutorial 36-04: 關於Mock Property的property, 使用NSubstitute

    • 單元 23 - Tutorial 37講義: 關於Mock的Verify

    • 單元 24 - Tutorial 37-01: 關於Mock的Verify, 使用Moq

    • 單元 25 - Tutorial 37-02: 關於Mock的Verify, 使用NSubstitute

    • 單元 26 - Tutorial 37-03: 關於Mock的Verify搭配Helper, 使用Moq

    • 單元 27 - Tutorial 37-04: 關於Mock的Verify搭配Helper, 使用NSubstitute

    • 單元 28 - Tutorial 38講義: 關於Mock的Callback

    • 單元 29 - Tutorial 38-01: 關於Mock的Callback, 使用Moq

    • 單元 30 - Tutorial 38-02: 關於Mock的Callback, 使用NSubstitute

    • 單元 31 - Tutorial 39講義: 關於Mock Event

    • 單元 32 - Tutorial 39-01: 關於Test真實的Event, 使用Moq

    • 單元 33 - Tutorial 39-02: 關於Test真實的Event, 使用NSubstitute

    • 單元 34 - Tutorial 39-03: 關於Mock的Event, 使用Moq

    • 單元 35 - Tutorial 39-04: 關於Mock的Event, 使用NSubstitute

    • 單元 36 - Tutorial 40講義: 關於Mock Behavior

    • 單元 38 - Tutorial 40-02: 關於Mock Repository

    • 單元 39 - Tutorial 40-03: 關於Mock Repository並且使用Recursive Mocking

    • 單元 41 - Tutorial 41-01: 關於Mock Base Class的Protected Member

    • 單元 42 - Tutorial 41-02: 關於Mock Base Class的Protected Abstract Member

    • 單元 43 - Tutorial 41-03: 關於Mock Sub Class的Protected Member

    • 單元 40 - Tutorial 41講義: 關於Mock Protected Member

    • 單元 44 - Tutorial 41-04: 關於Mock Base Class的Public Member

  • 7

    第 7 章 關於IEquatable; IComparable, IComparable ; IComparer, IComparer, IEqualityComparer

    • 單元 1 - Tutorial 42講義: 一些準備

    • 單元 2 - Tutorial 42: 一些準備

    • 單元 3 - Tutorial 43講義: 關於IEquatable和Assert

    • 單元 4 - Tutorial 43-01: 普通Dependency使用IEquatable,實作GamerPowerA

    • 單元 5 - Tutorial 43-02: 普通Dependency使用IEquatable,實作GamerA

    • 單元 6 - Tutorial 43-03: 測試普通Dependency使用IEquatable, GamerA有GamerPowerA

    • 單元 7 - Tutorial 43-04: 互相Dependency使用IEquatable,實作GamerPowerB

    • 單元 8 - Tutorial 43-05: 互相Dependency使用IEquatable,實作GamerB

    • 單元 9 - Tutorial 43-06: 測試互相Dependency使用IEquatable, GamerB和GamerPowerB互相擁有

    • 單元 10 - Tutorial 43-07: IEquatable的Summary

    • 單元 11 - Tutorial 44講義: 關於IEqualityComparer和Assert

    • 單元 12 - Tutorial 44-01: 普通Dependency使用IEqualityComparer,實作GamerPowerC

    • 單元 13 - Tutorial 44-02: 普通Dependency使用IEqualityComparer,實作GamerC

    • 單元 14 - Tutorial 44-03: 測試普通DependencyIEqualityComparer, GamerC有GamerPowerC

    • 單元 15 - Tutorial 44-04: 互相Dependency使用IEqualityComparer,實作GamerPowerD

    • 單元 16 - Tutorial 44-05: 互相Dependency使用IEqualityComparer,實作GamerD

    • 單元 17 - Tutorial 44-06: 測試互相DependencyIEqualityComparer, GamerD和GamerPowerD互相擁有

    • 單元 18 - Tutorial 44-07: IEqualityComparer的Summary

    • 單元 19 - Tutorial 45講義: 關於IComparable和IComparable和Assert

    • 單元 20 - Tutorial 45-01: 普通Dependency使用IComparable和IComparable,實作GamerPowerE

    • 單元 21 - Tutorial 45-02: 普通Dependency使用IComparable和IComparable,實作GamerE

    • 單元 22 - Tutorial 45-03: 測試普通DependencyIComparable和IComparable, GamerE有GamerPowerE

    • 單元 23 - Tutorial 45-04: 互相Dependency使用IComparable和IComparable,實作GamerPowerF

    • 單元 24 - Tutorial 45-05: 互相Dependency使用IComparable和IComparable,實作GamerF

    • 單元 25 - Tutorial 45-06: 測試互相DependencyIComparable和IComparable, GamerF和GamerPowerF互相擁有

    • 單元 26 - Tutorial 45-07: IComparable和IComparable的Summary

    • 單元 27 - Tutorial 46講義: 關於IComparer, IComparer, IEqualityComparer和Assert, 實作普通Dependency

    • 單元 28 - Tutorial 46-01: 普通Dependency使用IComparer,實作GamerPowerG

    • 單元 29 - Tutorial 46-02: 普通Dependency使用IComparer,實作GamerPowerG

    • 單元 30 - Tutorial 46-03: 普通Dependency使用IComparer, IComparer, IEqualityComparer,實作GamerPowerG

    • 單元 31 - Tutorial 46-04: 普通Dependency使用IComparer,實作GamerG

    • 單元 32 - Tutorial 46-05: 普通Dependency使用IComparer,實作GamerG

    • 單元 33 - Tutorial 46-06: 普通Dependency使用IComparer, IComparer, IEqualityComparer,實作GamerG

    • 單元 34 - Tutorial 46-07: 測試普通IComparer和IComparer和IEqualityComparer, Ga

    • 單元 35 - Tutorial 47講義: 關於IComparer, IComparer, IEqualityComparer和Assert, 實作互相Dependency

    • 單元 36 - Tutorial 47-01: 互相Dependency使用IComparer, IComparer, IEqualityCompare,實作GamePowerH

    • 單元 37 - Tutorial 47-02: 互相Dependency使用IComparer, IComparer, IEqualityCompare

    • 單元 38 - Tutorial 47-03: 測試互相Dependency使用IComparer, IComparer, IEqualityCom

    • 單元 39 - Tutorial 47-04: IComparer, IComparer, IEqualityComparer的Summary