// deleteProduct404 validates deleting a product that does not exist.
deleteProduct404 validates deleting a product that does not exist.
// deleteProduct404 validates deleting a product that does not exist .
func deleteProduct404(t *testing.T) {
	id := bson.NewObjectId().Hex()
	r := httptest.NewRequest("DELETE", "/v1/products/"+id, nil)
	w := httptest.NewRecorder()
	r.Header.Set("Authorization", userAuthorization)
	a.ServeHTTP(w, r)
	t.Log("Given the need to validate deleting a product that does not exist.")
	{
		t.Logf("\tTest 0:\tWhen using the new product %s.", id)
		{
			if w.Code != http.StatusNotFound {
				t.Fatalf("\t%s\tShould receive a status code of 404 for the response : %v", tests.Failed, w.Code)
			}
			t.Logf("\t%s\tShould receive a status code of 404 for the response.", tests.Success)
			recv := w.Body.String()
			resp := "Entity not found"
			if !strings.Contains(recv, resp) {
				t.Log("Got :", recv)
				t.Log("Want:", resp)
				t.Fatalf("\t%s\tShould get the expected result.", tests.Failed)
			}
			t.Logf("\t%s\tShould get the expected result.", tests.Success)
		}
	}
}
func deleteProduct404 ( t * testing . T ) { id := bson . NewObjectId ( ) . Hex ( ) r := httptest . NewRequest ( " " , " " + id , nil ) w := httptest . NewRecorder ( ) r . Header . Set ( " " , userAuthorization ) a . ServeHTTP ( w , r ) t . Log ( " " ) { t . Logf ( " \t \t " , id ) { if w . Code != http . StatusNotFound { t . Fatalf ( " \t \t " , tests . Failed , w . Code ) } t . Logf ( " \t \t " , tests . Success ) recv := w . Body . String ( ) resp := " " if ! strings . Contains ( recv , resp ) { t . Log ( " " , recv ) t . Log ( " " , resp ) t . Fatalf ( " \t \t " , tests . Failed ) } t . Logf ( " \t \t " , tests . Success ) } } }
deleteProduct404 validates deleting a product that does not exist.
deleteProduct404 validates deleting a product that does not exist .