aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/messages_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-20 23:02:01 +0800
committerobscuren <geffobscura@gmail.com>2015-03-20 23:02:01 +0800
commita59bb053f4d2a4a28341c645c051c4c323581a1b (patch)
tree6f414de5c01c9cc69d2ee461ca49ef1858aa1ca6 /rpc/messages_test.go
parentdeee9cb170ff105992ede83c52013d0c2c4ad10d (diff)
parent28e1971272d5bab6aa683d3bbe711226ca1fef98 (diff)
downloaddexon-a59bb053f4d2a4a28341c645c051c4c323581a1b.tar
dexon-a59bb053f4d2a4a28341c645c051c4c323581a1b.tar.gz
dexon-a59bb053f4d2a4a28341c645c051c4c323581a1b.tar.bz2
dexon-a59bb053f4d2a4a28341c645c051c4c323581a1b.tar.lz
dexon-a59bb053f4d2a4a28341c645c051c4c323581a1b.tar.xz
dexon-a59bb053f4d2a4a28341c645c051c4c323581a1b.tar.zst
dexon-a59bb053f4d2a4a28341c645c051c4c323581a1b.zip
merge
Diffstat (limited to 'rpc/messages_test.go')
-rw-r--r--rpc/messages_test.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/rpc/messages_test.go b/rpc/messages_test.go
new file mode 100644
index 000000000..5274c91e4
--- /dev/null
+++ b/rpc/messages_test.go
@@ -0,0 +1,41 @@
+package rpc
+
+import (
+ "testing"
+)
+
+func TestInsufficientParamsError(t *testing.T) {
+ err := NewInsufficientParamsError(0, 1)
+ expected := "insufficient params, want 1 have 0"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}
+
+func TestNotImplementedError(t *testing.T) {
+ err := NewNotImplementedError("foo")
+ expected := "foo method not implemented"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}
+
+func TestDecodeParamError(t *testing.T) {
+ err := NewDecodeParamError("foo")
+ expected := "could not decode, foo"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}
+
+func TestValidationError(t *testing.T) {
+ err := NewValidationError("foo", "should be `bar`")
+ expected := "foo not valid, should be `bar`"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}