31885d2726
Preparing for version 0.1.0 Contains a real README, the test framework, and the API implementation
51 lines
1009 B
Go
51 lines
1009 B
Go
package groupme
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/gorilla/mux"
|
|
"github.com/stretchr/testify/suite"
|
|
)
|
|
|
|
type SMSModeAPISuite struct{ APISuite }
|
|
|
|
func (s *SMSModeAPISuite) SetupSuite() {
|
|
s.handler = smsModeTestRouter()
|
|
s.setupSuite()
|
|
}
|
|
|
|
func (s *SMSModeAPISuite) TestSMSModeCreate() {
|
|
s.Assert().NoError(s.client.CreateSMSMode(10, nil))
|
|
}
|
|
|
|
func (s *SMSModeAPISuite) TestSMSModeDelete() {
|
|
s.Assert().NoError(s.client.DeleteSMSMode())
|
|
}
|
|
func TestSMSModeAPISuite(t *testing.T) {
|
|
suite.Run(t, new(SMSModeAPISuite))
|
|
}
|
|
|
|
func smsModeTestRouter() *mux.Router {
|
|
router := mux.NewRouter()
|
|
|
|
// Create
|
|
router.Path("/users/sms_mode").
|
|
Methods("POST").
|
|
Name("CreateSMSMode").
|
|
HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
|
w.WriteHeader(201)
|
|
})
|
|
|
|
// Delete
|
|
router.Path("/users/sms_mode/delete").
|
|
Methods("POST").
|
|
Name("DeleteSMSMode").
|
|
HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
|
w.WriteHeader(200)
|
|
})
|
|
|
|
/*// Return test router //*/
|
|
return router
|
|
}
|