Last active
February 9, 2018 11:57
-
-
Save johndowns/cc82136612dbd89e9d9549cfd8193d36 to your computer and use it in GitHub Desktop.
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
it("should execute a query against the collection", function() { | |
// arrange | |
const mock = new Mock<ICollection>() | |
.setup(instance => instance.getSelfLink) | |
.returns(() => { return "self-link"; }) | |
.setup(instance => instance.queryDocuments) | |
.returns((selfLink: string, query: IParameterizedQuery, callback: (error: IFeedCallbackError, resources: Array<Object>, options: IFeedCallbackOptions) => void) => { | |
callback(null, [""], null); | |
return true; | |
}); | |
const collectionObject = mock.object(); | |
// act | |
getGroupedOrdersImpl(["1"], collectionObject); | |
// assert | |
mock.verify(instance => instance.queryDocuments, Times.Once()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment