Pester mocking azure cmdlets

Welcome Forums Pester Pester mocking azure cmdlets

Viewing 2 reply threads
  • Author
    Posts
    • #164241
      Naw
      Participant
      Topics: 4
      Replies: 45
      Points: 94
      Rank: Member

      Hello
      I am trying out Pester for the unit testing. Is there better another way to test this or am I doing completely wrong?
      Here is the function I need to test for unit testing.

      Here is the Pester test describe block.

      It said the virtual network was null and the test failed.
      Thanks.

    • #165280
      Naw
      Participant
      Topics: 4
      Replies: 45
      Points: 94
      Rank: Member

      I have got this now. Just follow the pattern on the mock from this link.
      https://4sysops.com/archives/mocking-with-pester-in-powershell-unit-testing/

    • #165283
      Senior Moderator
      Topics: 9
      Replies: 1309
      Points: 4,784
      Helping Hand
      Rank: Community Hero

      Thanks for sharing the update/solution here.

Viewing 2 reply threads
  • The topic ‘Pester mocking azure cmdlets’ is closed to new replies.