tested and functional in memory db
This commit is contained in:
26
main_test.go
26
main_test.go
@@ -56,8 +56,32 @@ func TestApi(t *testing.T) {
|
|||||||
Username: username,
|
Username: username,
|
||||||
}
|
}
|
||||||
|
|
||||||
keypadSize = model.KeypadSize{NumbOfKeys: 5, AttrsPerKey: 10}
|
var loginInterfaceResp model.GetLoginInterfaceResp
|
||||||
|
testApiCall(t, base+api.GetLoginInterface, loginInterfaceBody, &loginInterfaceResp)
|
||||||
|
|
||||||
|
keypadSize = model.KeypadSize{NumbOfKeys: 5, AttrsPerKey: 10}
|
||||||
|
loginKeySelection, err := nkode.SelectKeyByAttrIdx(loginInterfaceResp.UserInterface, userPasscode, keypadSize)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
loginBody := model.LoginPost{
|
||||||
|
CustomerId: customerResp.CustomerId,
|
||||||
|
Username: username,
|
||||||
|
KeySelection: loginKeySelection,
|
||||||
|
}
|
||||||
|
|
||||||
|
testApiCall(t, base+api.Login, loginBody, nil)
|
||||||
|
|
||||||
|
renewBody := model.RenewAttributesPost{CustomerId: customerResp.CustomerId}
|
||||||
|
testApiCall(t, base+api.RenewAttributes, renewBody, nil)
|
||||||
|
|
||||||
|
loginKeySelection, err = nkode.SelectKeyByAttrIdx(loginInterfaceResp.UserInterface, userPasscode, keypadSize)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
loginBody = model.LoginPost{
|
||||||
|
CustomerId: customerResp.CustomerId,
|
||||||
|
Username: username,
|
||||||
|
KeySelection: loginKeySelection,
|
||||||
|
}
|
||||||
|
|
||||||
|
testApiCall(t, base+api.Login, loginBody, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Unmarshal(t *testing.T, resp *http.Response, data any) {
|
func Unmarshal(t *testing.T, resp *http.Response, data any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user