add test for train()