Last active
April 22, 2018 19:46
-
-
Save petergtz/28fc08c681c96af7a060bb2f7c7c3dc2 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
// Stubbing: | |
When(updater.NotifyUploadSucceeded(AnyString(), AnyString(), AnyString())). | |
ThenReturn(fmt.Errorf("Some error")) | |
// Exercise object under test: | |
handler.AddOrReplace(responseWriter, ..., map[string]string{"identifier": "someguid"}) | |
// Verification: | |
blobstore.VerifyWasCalledOnce().Put(EqString("someguid"), AnyReadSeeker()) | |
updater.VerifyWasCalled(Never()).NotifyUploadFailed(AnyString(), AnyError()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment