github.com/1and1/oneandone-cloudserver-sdk-go@v1.4.1/errors_test.go (about)

     1  package oneandone
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestCreateError(t *testing.T) {
     8  	err := ApiError{httpStatusCode: 404, message: "Not found"}
     9  
    10  	if err.HttpStatusCode() != 404 {
    11  		t.Errorf("Wrong HTTP status code.")
    12  	}
    13  	if err.Message() != "Not found" {
    14  		t.Errorf("Wrong HTTP error message.")
    15  	}
    16  }