This file contains hidden or 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
$LinksCopy = Import-Clixml $Filename |
This file contains hidden or 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
public class Gnabber | |
{ | |
public bool IsEvenNumber(int number) | |
{ | |
return number % 2 == 0; | |
} | |
} |
This file contains hidden or 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
public class Tests | |
{ | |
[Fact] | |
public void IsEvenNumber_WhenGivenAnEvenNumber_ItReturnsTrue() | |
{ | |
var gna = new Gnabber(); | |
Assert.True(gna.IsEvenNumber(42)); | |
} | |
[Fact] |
This file contains hidden or 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 IsEvenNumber($number) { | |
return $number % 2 -eq 0 | |
} |
This file contains hidden or 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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' | |
. "$here\$sut" | |
Describe "IsEvenNumber" { | |
Context "When an even number is passed to the function" { | |
$result = IsEvenNumber(42) | |
It "Returns true" { |
This file contains hidden or 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.IO; | |
using System.Linq; | |
using Moq; | |
using Xunit; | |
namespace CSharpSample | |
{ | |
public interface IDirectory | |
{ |
This file contains hidden or 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 HasEntryInDirectory($filename, $path) { | |
$entries = Get-ChildItem -Path $path | |
$entries -contains $filename | |
} |
This file contains hidden or 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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' | |
. "$here\$sut" | |
$mockReply = @("Monday.txt", "Tuesday.txt", "Wednesday.txt") | |
Describe "HasEntryInDirectory" { | |
Context "If the filename exists in the directory" { | |
Mock Get-ChildItem {return $mockReply} |
This file contains hidden or 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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' | |
. "$here\$sut" | |
$mockReply = @("Monday.txt", "Tuesday.txt", "Wednesday.txt") | |
Describe "HasEntryInDirectory" { | |
Context "If the filename exists in the directory" { | |
Mock Get-ChildItem {return $mockReply} |
This file contains hidden or 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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' | |
. "$here\$sut" | |
$mockReply = @("Monday.txt", "Tuesday.txt", "Wednesday.txt") | |
Describe "HasEntryInDirectory" { | |
Context "If the filename exists in the directory" { | |
Mock Get-ChildItem {return $mockReply} |