課程時間

🔧【Tools工具安裝】5:07:24

🎬【Preview導讀】2:49:20

🎬【TestEpisode2(第2篇)-MockingFramework(隔離框架)-NSubstitute、Moq】19:47:36

課程章節

請按「Preview」預覽章節。

  關於本課程
Available in days
days after you enroll
  討論TestDouble(模擬物件)的Dummy、Stub、Spy、Mock、Fake。非必要的CodeCoverage(程式碼覆蓋率)、TestDouble(模擬物件)範例
Available in days
days after you enroll
  討論MockingFramework(隔離框架)-Moq、NSubstitute
Available in days
days after you enroll
  討論IEquatable。IComparable、IComparable。IComparer、IComparer。IEqualityComparer
Available in days
days after you enroll
  課程評價
Available in days
days after you enroll
請選付款方案

🔴如果您在HiSKIO上購買了課程,則無需在Teachable重新購買相同課程。

請注意,Teachable Pay的發票無法提供給台灣公司報稅,如果需要台灣發票報稅,請去HiSKIO購買。

Teachable可能會產大約5%的「海外交易費」(詳情請諮詢您的發卡機構),為了學生權益,請使用「10%off」折價券

「Bundle」(組合包)更划算!

#「.Net Framework」相關系列「Bundle」(組合包)

  • 🚀「包含5堂課」B-2-TSQL、C#、Linq、MVC、API同步攻略(Click here)
  • 🚀「包含6堂課」B-3-EF(.NetFramework)學程第1-6篇(Click here)
  • 🚀「包含5堂課」B-4-單元整合測試學程第1-5篇(Click here)
  • 🚀「包含16堂課」B-5-扎實打底.NetFramework學程-TSQL、C#、LINQ、MVC、API、EF第1-6篇、測試第1-5篇(Click here)
  • 🚀「IT工具人學院全部課程」B-1-1-All Course Membership全能學生證(Click here)

.Net Framework Serious(學程)

注意: 因為此系列已經沒有新東西可以教了,所以這個學程不會再加入新內容了!

#請來這邊看「.Net Framework Serious(學程)」簡介(Click here)

  • 🚀2-1-TSQL(.NetFramework)扎實打底(Click here)
  • 🚀2-2-C#(.NetFramework)深入解析(Click here)
  • 🚀2-3-Linq(.NetFramework)完全攻略(Click here)
  • 🚀2-4-Asp.NetMVC(.NetFramework)完全精通(Click here)
  • 2-5A-EF(1to3)(.NetFramework)
  • 🚀2-5A-1-EntityFrameworkEpisode1(第1篇)-CodeFirst、DBFirst(Click here)
  • 🚀2-5A-2-EntityFrameworkEpisode2(第2篇)-FluentAPI、DataAnnotation(Click here)
  • 🚀2-5A-3-EntityFrameworkEpisode3(第3篇)-UnitOfWorkWithRepository(Click here)
  • 2-6B-Test(1to5)(.NetFramework)
  • 🚀2-6B-1-TestEpisode1(第1篇)-TestFramework(測試框架)-MSTest、NUnit(Click here)
  • 🚀2-6B-2-TestEpisode2(第2篇)-MockingFramework(隔離框架)-NSubstitute、Moq(Click here)(👈😁你現在在此!)
  • 🚀2-6B-3-TestEpisode3(第3篇)-UnitTest(單元測試)、IntegrationTest(整合測試)(Click here)
  • 🚀2-6B-4-TestEpisode4(第4篇)-FluentAssertionsPart1(Click here)
  • 🚀2-6B-5-TestEpisode5(第5篇)-FluentAssertionsPart2(Click here)
  • 2-7B-EF(4to6)(.NetFramework)PocoGenerator
  • 🚀2-7B-4-EntityFrameworkEpisode4(第4篇)-PocoGenerator(Click here)
  • 🚀2-7B-5-EntityFrameworkEpisode5(第5篇)-Test、UnitOfWorkWithRepositoryPart1(Click here)
  • 🚀2-7B-6-EntityFrameworkEpisode6(第6篇)-Test、UnitOfWorkWithRepositoryPart2(Click here)
  • 🚀2-8-Asp.NetMvcApi(.NetFramework)(VS2017)扎實打底(Click here)

本課簡介

Hi My name is Kevin. 我是一名移民到澳大利亞的軟體工程師,個人專注於各種技術和使用者界面的開發與研究。

TestEpisode2(第2篇)-MockingFramework(隔離框架)-NSubstitute、Moq】是一門銜接一門的「.Net Framework學程」中其中一個課程。

此篇會(T32ToT33)討論TestDouble(模擬物件)的Dummy、Stub、Spy、Mock、Fake。非必要的CodeCoverage(程式碼覆蓋率)、TestDouble(模擬物件)範例。接著(T34ToT41)討論MockingFramework(隔離框架)-Moq、NSubstitute。最後(T42ToT47)討論IEquatable<T>。IComparable<T>、IComparable。IComparer、IComparer<T>。IEqualityComparer<T>。

Course Highlight(本課魔王)

😈第一魔王,(T32ToT33)討論TestDouble(模擬物件)的Dummy、Stub、Spy、Mock、Fake。非必要的CodeCoverage(程式碼覆蓋率)、TestDouble(模擬物件)範例

😈第二魔王,(T34ToT41)討論MockingFramework(隔離框架)-Moq、NSubstitute

😈第三魔王,(T42ToT47)討論IEquatable<T>。IComparable<T>、IComparable。IComparer、IComparer<T>。IEqualityComparer<T>

想朝軟體工程師之路前進嗎?受夠了像是文字天書,艱深難懂的工具文件嗎?對自己的底子沒信心嗎?若你想扎實打底,本課程將讓你收穫滿滿!歡迎加入「IT工具人學院,帶你學到會」,一起練功吧!!顆顆。

工具安裝

🔧Microsoft SQL Server

🔧Visual Studio

🔧NUnit Test Adapter

課前技能

✍HTML 5 CSS3

✍Javascript

✍TSQL

✍C#

✍Linq

✍Asp . Net MVC (. Net Framework)

單元簡介

導讀

  • (P1)關於測試
  • (P2)UnitTest(單元測試)、IntegrationTest(整合測試)、EndToEndTest(端對端測試)
  • (P3)導讀Test(1to5)(.NetFramework)
  • (P3-1)導讀Test(1to5)(.NetFramework)
  • (P3-2)導讀Test(1)(.NetFramework)
  • (P3-3)導讀Test(2)(.NetFramework)
  • (P3-4)導讀Test(3)(.NetFramework)
  • (P3-5)導讀Test(4)(.NetFramework)
  • (P3-6)導讀Test(5)(.NetFramework)

討論TestDouble(模擬物件)的Dummy、Stub、Spy、Mock、Fake。非必要的CodeCoverage(程式碼覆蓋率)、TestDouble(模擬物件)範例

  • (T32)討論TestDouble(模擬物件)的Dummy、Stub、Spy、Mock、Fake
  • (T32-1)討論TestDouble(模擬物件)
  • (T32-2)討論可做UnitTest(單元測試)的程式碼
  • (T32-3)討論Dummy
  • (T32-4)討論Stub
  • (T32-5)討論Spy
  • (T32-6)討論Mock
  • (T32-7)討論Fake
  • (T32-8)討論不可做UnitTest(單元測試)的程式碼
  • (T32-9)討論MockingFramework(隔離框架)NSubstitute產生Fake
  • (T32-10)討論MockingFramework(隔離框架)NSubstitute產生Dummy
  • (T32-11)討論MockingFramework(隔離框架)Moq產生Fake、Dummy
  • (T32-12)討論CodeCoverage(程式碼覆蓋率)
  • (T33)非必要的CodeCoverage(程式碼覆蓋率)範例。非必要的TestDouble(模擬物件)範例
  • (T33-1)前置準備,非必要的CodeCoverage(程式碼覆蓋率)範例
  • (T33-2)非必要的CodeCoverage(程式碼覆蓋率)範例
  • (T33-3)前置準備,非必要的TestDouble(模擬物件)範例
  • (T33-4)非必要的TestDouble(模擬物件)範例,用Moq實作非必要的Property、voidMethod
  • (T33-5)非必要的TestDouble(模擬物件)範例,用NSubstitute實作非必要的Property

討論MockingFramework(隔離框架)-Moq、NSubstitute

  • (T34)T34toT41-討論MockingFramework(隔離框架)NSubstitute、Moq的前置準備,寫Interface、Class
  • (T34-1)T34toT41-討論MockingFramework(隔離框架)NSubstitute、Moq的前置準備,寫Interface
  • (T34-2)T34toT41-討論MockingFramework(隔離框架)NSubstitute、Moq的前置準備,寫Class
  • (T35)T34toT41-用Moq、NSubstitute來Mock(仿製)假Method、來Mock(仿製)假Method回傳某Exception
  • (T35-1)T34toT41-用Moq、NSubstitute來Mock(仿製)假Method
  • (T35-2)T34toT41-ArgumentMatchingMethod。用Moq來Mock(仿製)假Method,參數在某範圍內都回傳True
  • (T35-3)T34toT41-ArgumentMatchingMethod。用NSubstitute來Mock(仿製)假Method,參數在某範圍內都回傳True
  • (T35-4)T34toT41-OutParameterMethod。用Moq來Mock(仿製)假Method,當參數為某值,Out參數則為某值,就回傳True
  • (T35-5)T34toT41-OutParameterMethod。用NSubstitute來Mock(仿製)假Method,當參數為某值,Out參數則為某值,就回傳True
  • (T35-6)T34toT41-RefParameterMethod。用Moq來Mock(仿製)假Method,當Ref參數為某值,就回傳True
  • (T35-7)T34toT41-RefParameterMethod。用NSubstitute來Mock(仿製)假Method,當Ref參數為某值,就回傳True
  • (T35-8)T34toT41-AnyValueArgumentMethod。用Moq來Mock(仿製)假Method,當參數為某String,就轉成小寫並回傳
  • (T35-9)T34toT41-AnyValueArgumentrMethod。用NSubstitute來Mock(仿製)假Method,當參數為某String,就轉成小寫並回傳
  • (T35-10)T34toT41-CallbackMethod。用Moq來Mock(仿製)假Method,測試此Method被呼叫幾次
  • (T35-11)T34toT41-CallbackMethod。用NSubstitute來Mock(仿製)假Method,測試此Method被呼叫幾次
  • (T35-12)T34toT41-ThrowExceptionMethod。用Moq來Mock(仿製)假Method會產生某Exception
  • (T35-13)T34toT41-ThrowExceptionMethod。用NSubstitute來Mock(仿製)假Method會產生某Exception
  • (T36)T34toT41-用Moq、NSubstitute來Mock(仿製)假VoidMethod、假Property、假Property的Property
  • (T36-1)T34toT41-用Moq來Mock(仿製)假Property、假VoidMethod
  • (T36-2)T34toT41-用NSubstitute來Mock(仿製)假Property、假VoidMethod
  • (T36-3)T34toT41-用Moq來Mock(仿製)假Property的Property
  • (T36-4)T34toT41-用NSubstitute來Mock(仿製)假Property的Property
  • (T37)T34toT41-討論Moq、NSubstitute的Verify、Helper
  • (T37-1)T34toT41-討論Moq的Verify。測試特定參數的Method已經被Mock(仿製)並且被呼叫了特定次數,則回傳True
  • (T37-2)T34toT41-討論NSubstitute的Verify。測試特定參數的Method已經被Mock(仿製)並且被呼叫了特定次數,則回傳True
  • (T37-3)T34toT41-討論Moq的Verify、Helper。測試有特定參數的Constructor的Class已經被Mock(仿製)並且被呼叫了特定次數,則回傳True
  • (T37-4)T34toT41-討論NSubstitute的Verify、Helper。測試有特定參數的Constructor的Class已經被Mock(仿製)並且被呼叫了特定次數,則回傳True
  • (T38)T34toT41-CallbackMethod。用Moq、NSubstitute來Mock(仿製)假Method,測試此Method被呼叫幾次
  • (T38-1)T34toT41-CallbackMethod。用Moq來Mock(仿製)假Method,測試此Method被呼叫幾次
  • (T38-2)T34toT41-CallbackMethod。用NSubstitute來Mock(仿製)假Method,測試此Method被呼叫幾
  • (T39)T34toT41-用Moq、NSubstitute來Mock(仿製)假Event
  • (T39-1)T34toT41-測試Event(在Moq專案)
  • (T39-2)T34toT41-測試Event(在NSubstitute專案)
  • (T39-3)T34toT41-用Moq來Mock(仿製)假Event
  • (T39-4)T34toT41-用NSubstitute來Mock(仿製)假Event
  • (T40)T34toT41-Moq的MockBehavior、MockRepository的的Loose、Strict和RecursiveMocking。Mock(仿製)物件、Property的Property
  • (T40-1)T34toT41-Moq的MockBehavior的Loose、Strict和RecursiveMocking。Mock(仿製)物件、Property的Property
  • (T40-2)T34toT41-Moq的MockRepository的Loose、Strict。Mock(仿製)物件
  • (T40-3)T34toT41-Moq的MockRepository的Loose、Strict、RecursiveMocking。Mock(仿製)Property的Property
  • (T41)T34toT41-不建議用Moq來Mock(仿製)BaseClass的ProtectedMember、ProtectedAbstractMember、SubClass的ProtectedMember
  • (T41-1)T34toT41-不建議用Moq來Mock(仿製)BaseClass的ProtectedMember
  • (T41-2)T34toT41-不建議用Moq來Mock(仿製)BaseClass的ProtectedAbstractMember
  • (T41-3)T34toT41-不建議用Moq來Mock(仿製)SubClass的ProtectedMember
  • (T41-4)T34toT41-用Moq來Mock(仿製)BaseClass的PublicMember

討論IEquatable<T>。IComparable<T>、IComparable。IComparer、IComparer<T>。IEqualityComparer<T>

  • (T42toT47)討論IEquatable<T>。IComparable<T>、IComparable。IComparer、IComparer<T>。IEqualityComparer<T>
  • (T42)T42toT47-前置準備
  • (T43)T42toT47-推薦-測試IEquatable<T>   (3.)
  • (T43-1)T42toT47-推薦-普通Dependency,GamerA有GamerPowerA。GamerPowerA實作IEquatableT
  • (T43-2)T42toT47-推薦-普通Dependency,GamerA有GamerPowerA。GamerA實作IEquatableT
  • (T43-3)T42toT47-推薦-測試普通Dependency,GamerA有GamerPowerA,都實作IEquatableT
  • (T43-4)T42toT47-推薦-互相Dependency,GamerB有GamerPowerB,反之亦然。GamerPowerB實作IEquatableT
  • (T43-5)T42toT47-推薦-互相Dependency,GamerB有GamerPowerB,反之亦然。GamerB實作IEquatableT
  • (T43-6)T42toT47-推薦-測試互相Dependency,GamerB有GamerPowerB,反之亦然,都實作IEquatableT
  • (T43-7)T42toT47-推薦-Summary總結,IEquatableT
  • (T44)T42toT47-推薦-測試IEqualityComparer<T>
  • (T44-1)T42toT47-推薦-普通Dependency,GamerC有GamerPowerC。GamerPowerC實作IEqualityComparerT
  • (T44-2)T42toT47-推薦-普通Dependency,GamerC有GamerPowerC。GamerC實作IEqualityComparerT
  • (T44-3)T42toT47-推薦-測試普通Dependency,GamerC有GamerPowerC,都實作IEqualityComparerT
  • (T44-4)T42toT47-推薦-互相Dependency,GamerD有GamerPowerD,反之亦然。GamerPowerD實作IEqualityComparerT
  • (T44-5)T42toT47-推薦-互相Dependency,GamerD有GamerPowerD,反之亦然。GamerD實作IEqualityComparerT
  • (T44-6)T42toT47-推薦-測試互相Dependency,GamerD有GamerPowerD,反之亦然,都實作IEqualityComparerT
  • (T44-7)T42toT47-推薦-Summary總結,IEqualityComparerT
  • (T45)T42toT47-測試IComparable<T>、IComparable
  • (T45-1)T42toT47-普通Dependency,GamerE有GamerPowerE。GamerPowerE實作IComparableT、IComparable
  • (T45-2)T42toT47-普通Dependency,GamerE有GamerPowerE。GamerE實作IComparableT、IComparable
  • (T45-3)T42toT47-測試普通Dependency,GamerE有GamerPowerE,都實作IComparableT、IComparable
  • (T45-4)T42toT47-互相Dependency,GamerF有GamerPowerF,反之亦然。GamerPowerF實作IComparableT、IComparable
  • (T45-5)T42toT47-互相Dependency,GamerF有GamerPowerF,反之亦然。GamerF實作IComparableT、IComparable
  • (T45-6)T42toT47-測試互相Dependency,GamerF有GamerPowerF,反之亦然,都實作IComparableT、IComparable
  • (T45-7)T42toT47-Summary總結,IComparableT、IComparable
  • (T46)T42toT47-推薦-測試普通Dependency,GamerG有GamerPowerG,都實作IComparer、IComparer<T>、IEqualityComparer<T>
  • (T46-1)T42toT47-推薦-普通Dependency,GamerG有GamerPowerG。GamerPowerG實作IComparerT
  • (T46-2)T42toT47-推薦-普通Dependency,GamerG有GamerPowerG。GamerPowerG實作IComparer
  • (T46-3)T42toT47-推薦-普通Dependency,GamerG有GamerPowerG。GamerPowerG實作IEqualityComparerT
  • (T46-4)T42toT47-推薦-普通Dependency,GamerG有GamerPowerG。GamerG實作IComparerT
  • (T46-5)T42toT47-推薦-普通Dependency,GamerG有GamerPowerG。GamerG實作IComparer
  • (T46-6)T42toT47-推薦-普通Dependency,GamerG有GamerPowerG。GamerG實作IEqualityComparerT
  • (T46-7)T42toT47-推薦-測試普通Dependency,GamerG有GamerPowerG,都實作IComparer、IComparerT、IEqualityComparerT
  • (T47)T42toT47-推薦-測試互相Dependency,GamerH有GamerPowerH,反之亦然,都實作IComparer、IComparer<T>、IEqualityComparer<T>
  • (T47-1)T42toT47-推薦-互相Dependency,GamerPowerH實作IComparer、IComparerT、IEqualityComparerT
  • (T47-2)T42toT47-推薦-互相Dependency,GamerH實作IComparer、IComparerT、IEqualityComparerT
  • (T47-3)T42toT47-推薦-測試互相Dependency,GamerH有GamerPowerH,反之亦然,都實作IComparer、IComparerT、IEqualityComparerT
  • (T47-4)T42toT47-推薦-Summary總結,IComparer、IComparerT、IEqualityComparerT