Skip to content

Instantly share code, notes, and snippets.

@ffMathy
Created August 22, 2018 20:33
Show Gist options
  • Save ffMathy/33a07d8959f4e4fcad90f0fd6056b38b to your computer and use it in GitHub Desktop.
Save ffMathy/33a07d8959f4e4fcad90f0fd6056b38b to your computer and use it in GitHub Desktop.
const mockedCalculator = TypeMoq.Mock.ofType(RealCalculator);
const calculator = mockedCalculator.object;
calculator.add(1, 2);
mockedCalculator.verify(x => x.add(TypeMoq.It.isAny(), 2), Times.atLeastOnce());
mockedCalculator.verify(x => x.add(1, TypeMoq.It.is(y => y >= 1 && y <= 5)), Times.atLeastOnce());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment