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
powershell.exe -Command "git fetch --all; git branch --merged | ForEach-Object { $_.Trim() } | Where-Object {$_ -NotMatch \"^\*\"} | Where-Object {-not ( $_ -Like \"*master\" -or $_ -Like \"*main\" -or $_ -Like \"*develop\" )} | ForEach-Object { git branch -d $_ }; git fetch --all; git remote prune origin; git fetch --all" |
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
const mockedCalculator = Substitute.for<RealCalculator>(); | |
mockedCalculator.add(1, 2); | |
mockedCalculator.received(1).add(1, 2); //called exactly once | |
mockedCalculator.received().add(1, 2); //called at least once |
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
const mockedCalculator = mock(RealCalculator); | |
const calculator = instance(mockedCalculator); | |
calculator.add(1, 2); | |
verify(mockedCalculator.add(1, 2)).once(); //called exactly once | |
verify(mockedCalculator.add(1, 2)).atLeast(0); //called at least once |
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
const mockedCalculator = TypeMoq.Mock.ofType(RealCalculator); | |
const calculator = mockedCalculator.object; | |
calculator.add(1, 2); | |
mockedCalculator.verify(x => x.add(1, 2), TypeMoq.Times.once()); //called exactly once | |
mockedCalculator.verify(x => x.add(1, 2), TypeMoq.Times.atLeastOnce()); //called at least once |
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
//no need for two objects | |
const mockedCalculator = Substitute.for<RealCalculator>(); |
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
const mockedCalculator = mock(RealCalculator); | |
const calculator = instance(mockedCalculator); |
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
const mockedCalculator = TypeMoq.Mock.ofType(RealCalculator); | |
const calculator = mockedCalculator.object; |
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
const mockedCalculator = Substitute.for<CalculatorInterface>(); |
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
const mockedCalculator = Substitute.for<RealCalculator>(); | |
mockedCalculator.add(3, 4); | |
mockedCalculator.received().add(1, 2); |
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
const mockedCalculator = mock(RealCalculator); | |
const calculator = instance(mockedCalculator); | |
calculator.add(3, 4); | |
verify(mockedCalculator.add(1, 2)).called(); |
OlderNewer