mirror of
https://github.com/wahyd4/cash-code-test.git
synced 2026-08-24 12:45:59 +10:00
20 lines
387 B
Go
20 lines
387 B
Go
package commands
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/wahyd4/cash/domains"
|
|
)
|
|
|
|
func TestOpenAccountCommand_Run_ShouldCreateABankAccount(t *testing.T) {
|
|
command := OpenAccountCommand{
|
|
Username: "Mindy",
|
|
}
|
|
|
|
bank := domains.InitBank()
|
|
assert.Equal(t, len(bank.TotalAccounts()), 0)
|
|
command.Run(bank)
|
|
assert.Equal(t, len(bank.TotalAccounts()), 1)
|
|
}
|