Aryan-sharma11 / AddSevenPS

0 stars 1 forks source link

Loading Powershell Script to Unit tests #3

Closed Aryan-sharma11 closed 2 years ago

Aryan-sharma11 commented 2 years ago

Having issues in loading PowerShell script to Unit test

Right now referring to these documents

https://techcommunity.microsoft.com/t5/testingspot-blog/how-to-run-a-powershell-script-inside-a-unit-test-method/ba-p/367613

https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-fsharp-with-nunit

abhi18av commented 2 years ago

@Aryan-sharma11 , for now don't worry about integrating the Powershell class based unit tests.

Let's only focus on making sure that F# code is solid first and then we move on to other layers.

Aryan-sharma11 commented 2 years ago

@Aryan-sharma11 , for now don't worry about integrating the Powershell class based unit tests.

Let's only focus on making sure that F# code is solid first and then we move on to other layers.

But according to me, to add tests in the project this might be required as we are taking inputs from PowerShell and also using Cmdlets in the F# file

abhi18av commented 2 years ago

Yes, that is true in part.

However, we need to set boundaries and test within boundaries. In our codebase, we have two boundaries

  1. F#
  2. Powershell wrapper

Both of these would be tested using different testing frameworks (Pester for Powershell testing, see Powershell github repo for context).

For now, let's focus on testing F#.