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
type AcceptingAuthorizerSpy struct { | |
AuthorizeWasCalled bool | |
} | |
func (spy *AcceptingAuthorizerSpy) Authorize(username, password string) (bool, error) { | |
spy.AuthorizeWasCalled = true | |
return true, nil | |
} |
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 AcceptingAuthorizerVerificationMock implements Authorizer { | |
public boolean authorizeWasCalled = false; | |
public Boolean authorize(String username, String password) { | |
authorizeWasCalled = true; | |
return true; | |
} | |
public boolean verify() { | |
return authorizedWasCalled; |
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
type AcceptingAuthorizerVerificationMock struct { | |
AuthorizeWasCalled bool | |
} | |
func (mock *AcceptingAuthorizerVerificationMock) Authorize(username, password string) (bool, error) { | |
mock.AuthorizeWasCalled = true | |
return true, nil | |
} | |
func (mock *AcceptingAuthorizerVerificationMock) Verify() bool { |
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 AcceptingAuthorizerFake implements Authorizer { | |
public Boolean authorize(String username, String password) { | |
return username.equals("Bob"); | |
} | |
} |
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
type AcceptingAuthorizerFake struct { | |
} | |
func (fake *AcceptingAuthorizerFake) Authorize(username, password string) (bool, error) { | |
return (username == "Bob"), nil | |
} |
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
it("should call SaveOrder when click save", function() { | |
spyOn(service, "SaveOrder"); | |
var expectedArgument = { | |
id: "1", | |
items: [ | |
"item1", | |
"item2", | |
"item3" | |
] |
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
package main | |
import ( | |
"io" | |
"log" | |
"os" | |
) | |
type MyFile struct { | |
*os.File |
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
package main | |
import "fmt" | |
type Logger interface { | |
log(message string) | |
} | |
type DefaultLogger struct { | |
} |
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
" Start Pathogen for vim-gocode plugin | |
execute pathogen#infect() | |
Helptags | |
filetype plugin indent on | |
syntax on | |
set number | |
" Neocomplete Enable | |
"Note: This option must set it in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)! | |
" Disable AutoComplPop. |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func SecondCounter() { | |
for i := 1; i <= 20; i++ { | |
time.Sleep(1 * time.Second) |