How to Test PowerShell with Pester

所在平台: Udemy

课程主页: https://www.udemy.com/course/how-to-test-powershell-with-pester/

课程评论:没有评论

第一个写评论        关注课程

课程简介

**课程名称:** How to Test PowerShell with Pester **课程概述:** 本课程是关于 PowerShell 测试的入门课程,填补了 IT 领域的一项重要需求。通过本课程的学习,您将能够使用 Pester 框架,为 PowerShell 脚本和模块编写单元测试和集成测试,并掌握数据模拟(mocking)的技巧。课程内容结构清晰,讲解生动易懂,配有简单实用的示例,帮助您轻松掌握以下关键知识点: **课程内容:** * **PowerShell 测试框架:** 了解 Pester 的基本结构,包括 `Describe`、`It` 和 `Context` 块的用法。 * **测试用例编写:** 学习如何在单个和多个 `Context` 块中编写测试用例。 * **测试运行与结果解读:** 掌握 Pester 测试的运行方法以及如何解读测试结果。 * **Pester 中的 Mocking:** * 什么是 Mocking,以及其在测试中的作用。 * 如何 Mock 自定义函数。 * 如何 Mock 内置的 PowerShell Cmdlets。 * **`BeforeAll` 和 `BeforeEach`:** * 理解 `BeforeAll` 的作用,并通过示例学习其应用。 * 理解 `BeforeEach` 的作用,并通过示例学习其应用。 * **高级断言 (Assert):** * 学习使用 `Should -Be`、`Should -Contain` 等高级断言。 * 提供单个值和多个值的断言示例。 * **异常处理场景:** * 学习如何进行异常测试,包括负面测试用例。 * 提供异常测试的示例。 * **参数化测试:** * 理解参数化测试的概念。 * 学习如何使用参数化测试。 * **代码覆盖率与报告:** * 了解代码覆盖率的含义。 * 提供代码覆盖率的示例。 * **通过调用进行测试:** 学习如何通过调用方式进行测试。 **学习目标:** 完成本课程后,您将能够自信地开始 PowerShell 的测试工作,包括单元测试、集成测试及其他类型的测试。

课程评论(0条)

课程详情

This is the first course for this topic which is very much needed in the IT. By end of the Course You will be able to write the unit testing , Integration testing for powershell scripts and modules by mocking data. You will be able to learn all the following below topics with simple and good ExamplesThe course has been structured in such a manner that everything will be easy to Learn and easy to understand.Framework of PowerShell TestingWhat is Describe, it and Context blocksWriting Test case under Single contextWriting Test case under Multiple contextRunning tests and interpreting resultsMocking in PesterWhat is MockingMocking custom functionMocking built-in cmdletsWhat is Before AllBefore All ExampleWhat is Before EachBefore Each Examplewhat are advanced Assert (e.g., Should -Be, Should -Contain)Assert For single values exampleAssert For Multiple values exampleExceptions Handling ScenariosExceptions Testing Example(Negative cases testing)Parameterized TestsWhat is parameterized testingParameterized tests usingCode Coverage and ReportingWhat is code coverageCode Coverage ExampleTesting trough invokingThe above topics ensures you to get started with the PowerShell testing including unit testing and integration testing and others

课程标签

0人关注该课程

主题相关的课程