Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

v1 #1

wants to merge 1 commit into from

Conversation

Legibl
Copy link
Owner

@Legibl Legibl commented Apr 8, 2024

No description provided.

Copy link

@robotomize robotomize left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отличная работа, принято!


query := "UPDATE parcel SET address = ? WHERE number = ? AND status = ?"

res, err := s.db.Exec(query, address, number, ParcelStatusRegistered)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отлично!

}

if rowsAffected == 0 {
return fmt.Errorf("unable to change addres for parcel, incorrect status or parcel not found")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оки, круто, что подумали про этот кейс


res, err := store.Get(id)
require.NoError(t, err)
assert.Equal(t, res.Client, parcel.Client)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно в целом сделать следующим образом, чтобы не писать много кода и пвоерять каждое поле отдельно после того, как добавили посылку в БД и проверили, что нет ошибки

parcel.Number = id
assert.Equal(t, parcel, res)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants