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
Get-Module unapproved-verb, warning | Remove-Module | |
# this won't warn, we mutated the approved verbs list | |
Import-Module $PSScriptRoot\unapproved-verb.psm1 | |
# we clean up after ourselves in few seconds | |
Write-Host waiting... | |
Start-Sleep -Seconds | |
# this will warn again |
Prague has amazing public transport system, it is clean, convenient, and cheap way to get from point A to B, including from airport to city center. Prague public transport includes buses, trams, subway (metro), and some trains, boats, and also a funicular.
Tickets for Prague public transport can be bought in yellow machines, directly in trams and some busses, and more conveniently via PID Litacka app available for both iPhone and Android: https://app.pidlitacka.cz/
In the application you want to select Tickets > Buy a ticket > Prague
Tickets start at 30 CZK per single 30 minute ride for adult, but we recommend 330 CZK (14 EUR) 72 hour ticket, or 120 CZK (5 EUR) 24 hour ticket, if you plan to explore Prague a little bit.
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
using System.Diagnostics; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)] | |
namespace mstest; | |
[TestClass] | |
public class UnitTest1 | |
{ |
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
using System; | |
using System.Linq; | |
using System.Reflection; | |
namespace ConsoleApp28 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
# create a scriptblock that has scriptblock local data attached (data common to all invocation of the scriptblock) | |
# but is still bound to the same session state, this is differnt from closure, because closures are their own modules | |
$sb = { | |
$location | |
$self = $MyInvocation.MyCommand.ScriptBlock | |
($self.___data.Count++) | |
} | |
$sb.PSObject.Properties.Add([System.Management.Automation.PSNoteProperty]::new("___data", @{ Count = 1})) |
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
function Get-TestParents { | |
<# | |
.SYNOPSIS | |
Returns any parents not already known, top-down first, so that a hierarchy can be created in a streaming manner | |
#> | |
param ( | |
#Test to fetch parents of. For maximum efficiency this should be done one test at a time and then stack processed | |
[Parameter(Mandatory,ValueFromPipeline)][Pester.Test[]]$Test, | |
[HashSet[Pester.Block]]$KnownParents = [HashSet[Pester.Block]]::new() |
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
$c = New-PesterConfiguration | |
# your Path | |
$c.Run.Path = "." | |
$c.Run.PassThru = $true | |
# detailed prints the CC report, but that is very verbose | |
# use only for tiny codebases | |
# $c.Output.Verbosity = "Detailed" |
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
coverage.xml |
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
# ModuleName defines in which session state the mock will be effective, not in which module the function was defined. | |
# This is important when mocking functions exported from a module either when calling them from a script, or when calling | |
# them from a different module. In that case you want to define the mock in the place where the function is called from, | |
# not in the module where the function is defined. | |
# The only time you want to define the mock in the module where the function is defined is when you are testing an internal | |
# functions of the module (not shown here). | |
Invoke-Pester -Container ( | |
New-PesterContainer -ScriptBlock { | |
BeforeAll { | |
Get-Module m, n, o | Remove-Module |
NewerOlder