Slide 33
Slide 33 text
cases := testutil.Cases[args, mocks, returns]{
{
Name: "正常",
Args: args{
ctx: context.Background(),
userID: "userID",
cardID: "cardID",
level: 10,
},
Prepare: func(args args, m *mocks) {
m.cardService.EXPECT().
LevelUp(args.ctx, m.rwTx, args.userID, args.cardID, args.level).Return(dto.Resources{}, nil).Times(1)
m.consumptionService.EXPECT().
Consume(args.ctx, m.rwTx, args.userID, dto.Resources{}).Return(nil, nil).Times(1)
},
Returns: returns{},
},
}
テストケースの記述