remove commented old code

This commit is contained in:
Sonja Happ 2019-09-06 14:05:40 +02:00
parent 4914af6c47
commit a8cccba667

View file

@ -308,57 +308,3 @@ func TestGetAllSimulationModelsOfScenario(t *testing.T) {
assert.Equal(t, 1, NumberOfSimulationModels)
}
//// Test /models endpoints
//func TestSimulationModelEndpoints(t *testing.T) {
//
// var token string
//
// var myModels = []common.SimulationModelResponse{common.SimulationModelA_response, common.SimulationModelB_response}
// var msgModels = common.ResponseMsgSimulationModels{SimulationModels: myModels}
// var msgModel = common.ResponseMsgSimulationModel{SimulationModel: common.SimulationModelC_response}
// var msgModelupdated = common.ResponseMsgSimulationModel{SimulationModel: common.SimulationModelCUpdated_response}
//
// db := common.DummyInitDB()
// defer db.Close()
// common.DummyPopulateDB(db)
//
// router := gin.Default()
// api := router.Group("/api")
//
// // All endpoints require authentication except when someone wants to
// // login (POST /authenticate)
// user.RegisterAuthenticate(api.Group("/authenticate"))
//
// api.Use(user.Authentication(true))
//
// RegisterSimulationModelEndpoints(api.Group("/models"))
//
// credjson, _ := json.Marshal(common.CredUser)
// msgOKjson, _ := json.Marshal(common.MsgOK)
// msgModelsjson, _ := json.Marshal(msgModels)
// msgModeljson, _ := json.Marshal(msgModel)
// msgModelupdatedjson, _ := json.Marshal(msgModelupdated)
//
// token = common.AuthenticateForTest(t, router, "/api/authenticate", "POST", credjson, 200)
//
// // test GET models
// common.TestEndpoint(t, router, token, "/api/models?scenarioID=1", "GET", nil, 200, msgModelsjson)
//
// // test POST models
// common.TestEndpoint(t, router, token, "/api/models", "POST", msgModeljson, 200, msgOKjson)
//
// // test GET models/:ModelID to check if previous POST worked correctly
// common.TestEndpoint(t, router, token, "/api/models/3", "GET", nil, 200, msgModeljson)
//
// // test PUT models/:ModelID
// common.TestEndpoint(t, router, token, "/api/models/3", "PUT", msgModelupdatedjson, 200, msgOKjson)
// common.TestEndpoint(t, router, token, "/api/models/3", "GET", nil, 200, msgModelupdatedjson)
//
// // test DELETE models/:ModelID
// common.TestEndpoint(t, router, token, "/api/models/3", "DELETE", nil, 200, msgOKjson)
// common.TestEndpoint(t, router, token, "/api/models?scenarioID=1", "GET", nil, 200, msgModelsjson)
//
// // TODO add testing for other return codes
//
//}