-
-
Save bielawb/71abdd0b381dad68c02972de8ccc5218 to your computer and use it in GitHub Desktop.
Maskowanie ze zwracaniem obiektów.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$maskowaneObiekty = @( | |
@{ | |
title = 'Tytuł zamkniętego PRa' | |
body = 'Opis zamkniętego PRa' | |
user = @{ | |
login = 'użyszkodnik' | |
} | |
state = 'closed' | |
created_at = (Get-Date -Date 2017-Jan-01).ToUniversalTime().ToString('o') -replace '\.\d+' | |
closed_at = (Get-Date -Date 2017-Jan-31).ToUniversalTime().ToString('o') -replace '\.\d+' | |
}, | |
@{ | |
title = 'Tytuł otwartego PRa' | |
body = 'Opis otwartego PRa' | |
user = @{ | |
login = 'innyUżyszkodnik' | |
} | |
state = 'open' | |
created_at = (Get-Date -Date 2017-Jan-01).ToUniversalTime().ToString('o') -replace '\.\d+' | |
closed_at = '' | |
} | |
) | |
$maskujPrzyPomocy = @{ | |
Content = $maskowaneObiekty | ConvertTo-Json | |
} | |
Describe 'Zwracanie obiektów z różnymi właściwościami' { | |
Mock -CommandName Invoke-WebRequest -MockWith { | |
$maskujPrzyPomocy | |
} | |
# Testy... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment