Documentation
¶
Index ¶
- Constants
- func AssertResponse(t *testing.T, response *httptest.ResponseRecorder, expectedResponse Response)
- func ErrorMessageToJSON(message string) string
- func NewDeleteGradeRequest(id string) *http.Request
- func NewEditGradeRequest(id string, grade services.Grade) *http.Request
- func NewEditInvalidGradeRequest(id string, grade services.InvalidGrade) *http.Request
- func NewGetGradeRequest(id string) *http.Request
- func NewGetGradesByStudentRequest(student string) *http.Request
- func NewGetGradesRequest() *http.Request
- func NewPostGradeRequest(grade services.Grade) *http.Request
- func NewPostInvalidGradeRequest(grade services.InvalidGrade) *http.Request
- func ResultMessageAndDataToJSON(message, data string) string
- type Response
Constants ¶
View Source
const ( //Success constants GradesByStudent = "Successfully retrieved all the grades by student" AllGrades = "Successfully retrieved all grades" GradeInserted = "Successfully inserted grade with ID %s" GradeDeleted = "Successfully deleted grade with ID %s" GradeEdited = "Successfully edited grade with ID %s" GradeRetrieved = "Successfully retrieved the grade" //Errors constants GradeNotFound = "Grade not found" InvalidParameters = "Invalid parameters" MissingParameters = "Missing parameters" ValueShouldBeGreater = "Grade value should be greater than zero" DeleteFailed = "Failed to delete the grade" EditFailed = "Failed to edit the grade" )
Variables ¶
This section is empty.
Functions ¶
func AssertResponse ¶
func AssertResponse(t *testing.T, response *httptest.ResponseRecorder, expectedResponse Response)
func ErrorMessageToJSON ¶
func NewDeleteGradeRequest ¶
func NewEditInvalidGradeRequest ¶
func NewEditInvalidGradeRequest(id string, grade services.InvalidGrade) *http.Request
func NewGetGradeRequest ¶
func NewGetGradesRequest ¶
func NewPostInvalidGradeRequest ¶
func NewPostInvalidGradeRequest(grade services.InvalidGrade) *http.Request
Types ¶
Click to show internal directories.
Click to hide internal directories.