diff --git a/subcommands/subcommand_test.go b/subcommands/subcommand_test.go index b3d4af7..093282f 100644 --- a/subcommands/subcommand_test.go +++ b/subcommands/subcommand_test.go @@ -200,3 +200,27 @@ func TestSubCommandUnknownSC(t *testing.T) { } } } + +func TestLengthArgs(t *testing.T) { + //Create a mock subcommand + msc := NewMockSC() + + //Set the error message + msc.ErrorMsg = "Test error is being throw properly if the length of the args variable is < 1" + + //Create an argument array + args := []string{} + + //Create an array of Runner interface containing the mock subcommand + scmds := []Runner{ + msc, + } + + //Run the SubCommand function + err := SubCommand(args, scmds) + + //Should have an error + if err == nil { + t.Fatalf("SubCommand: Expected to have error: %s | Received No Error", msc.ErrorMsg) + } +}