diff --git a/x/cosmostest/keeper/keeper_integration_test.go.bak b/x/cosmostest/keeper/keeper_integration_test.go.bak new file mode 100644 index 0000000..325c403 --- /dev/null +++ b/x/cosmostest/keeper/keeper_integration_test.go.bak @@ -0,0 +1,49 @@ +// Reference file. + +package keeper + +import ( + "cosmos-test/x/cosmostest" + "cosmos-test/x/cosmostest/types" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/stretchr/testify/suite" + tendermintTypes "github.com/tendermint/tendermint/proto/tendermint/types" +) + +// Integration Tests Tutorial: +// https://tutorials.cosmos.network/academy/3-my-own-chain/game-wager.html#integration-tests + +// Example integration test suite: +// https://github.com/cosmos/cosmos-sdk/blob/9e1ec7b/x/bank/keeper/keeper_test.go#L66-L110 + +type IntegrationTestSuite struct { + suite.Suite + + app cosmostest.AppModule + msgServer types.MsgServer + ctx sdk.Context + queryClient types.QueryClient +} + +func (suite *IntegrationTestSuite) SetupTest() { + suite.app = cosmostest.AppModule{ + Keeper: NewKeeper(cdc) + } + suite.ctx = suite.app.NewContext(false, tendermintTypes.Header{Time: time.Now()}) + suite.app.AccountKeeper.SetParams(suite.ctx, authtypes.DefaultParams()) + suite.app.BankKeeper.SetParams(suite.ctx, banktypes.DefaultParams()) + queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) + types.RegisterQueryServer(queryHelper) + suite.queryClient = types.NewQueryClient(queryHelper) +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} diff --git a/x/cosmostest/module_test.go.bak b/x/cosmostest/module_test.go.bak new file mode 100644 index 0000000..e48b470 --- /dev/null +++ b/x/cosmostest/module_test.go.bak @@ -0,0 +1,42 @@ +package cosmostest + +import ( + "cosmos-test/x/cosmostest/types" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/stretchr/testify/suite" + tendermintTypes "github.com/tendermint/tendermint/proto/tendermint/types" +) + +// Integration Tests Tutorial: +// https://tutorials.cosmos.network/academy/3-my-own-chain/game-wager.html#integration-tests + +// Example integration test suite: +// https://github.com/cosmos/cosmos-sdk/blob/9e1ec7b/x/bank/keeper/keeper_test.go#L66-L110 + +type IntegrationTestSuite struct { + suite.Suite + + app *AppModule + msgServer types.MsgServer + ctx sdk.Context + queryClient types.QueryClient +} + +func (suite *IntegrationTestSuite) SetupTest() { + suite.ctx = suite.app.NewContext(false, tendermintTypes.Header{Time: time.Now()}) + suite.app.AccountKeeper.SetParams(suite.ctx, authtypes.DefaultParams()) + suite.app.BankKeeper.SetParams(suite.ctx, banktypes.DefaultParams()) + queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) + types.RegisterQueryServer(queryHelper) + suite.queryClient = types.NewQueryClient(queryHelper) +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +}