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
package main | |
import ( | |
"flag" | |
"fmt" | |
factory "github.com/ShaileshSurya/go-external-mocking/dependfactory" | |
) | |
func main() { |
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
package dependfactory | |
import ( | |
dep "github.com/ShaileshSurya/go-external-mocking/dependfactory/dependency" | |
"github.com/ShaileshSurya/go-external-mocking/dependfactory/interfacer" | |
"github.com/ShaileshSurya/go-external-mocking/dependfactory/mock" | |
) | |
// GetExternal ... | |
func GetExternal(env string) interfacer.External { |
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
package mock | |
import ( | |
"errors" | |
"fmt" | |
"github.com/ShaileshSurya/go-external-mocking/dependfactory/interfacer" | |
) | |
// MockExternal ... | |
type MockExternal struct { |
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
package dependfactory | |
import ( | |
dep "github.com/ShaileshSurya/go-external-mocking/dependfactory/dependency" | |
"github.com/ShaileshSurya/go-external-mocking/dependfactory/interfacer" | |
) | |
// GetExternal ... | |
func GetExternal() interfacer.External { | |
return dep.External{} |
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
package dependfactory | |
import ( | |
"github.com/ShaileshSurya/go-external-mocking/dependfactory/interfacer" | |
dep "github.com/ShaileshSurya/go-external-mocking/external" | |
) | |
// External ... | |
type External struct { | |
interfacer.External |
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
package interfacer | |
// External interface encaspulates the actual dependency function. | |
type External interface { | |
DependencyFunction() (err error) | |
} |
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
package main | |
import ( | |
"fmt" | |
"github.com/go-external-mocking/external" | |
) | |
func main() { | |
err := external.DependencyFunction() |
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
package external | |
import "fmt" | |
// DependencyFunction ... | |
func DependencyFunction() (err error) { | |
fmt.Println("Hurray Dependency Function is called") | |
return | |
} |
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
package main | |
import ( | |
"fmt" | |
factory "github.com/ShaileshSurya/go-external-mocking/dependfactory" | |
) | |
func main() { | |
external := factory.GetExternal() | |
err := external.DependencyFunction() |
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
import java.util.Scanner; | |
public class SelectionSort{ | |
public static final int MAX=9999; | |
private int [] unsortedArray; | |
public void setUnsortedArray(int []unsortedArray){ |