summaryrefslogtreecommitdiff
path: root/domain_test.go
diff options
context:
space:
mode:
authorhorus_arch2015-03-20 01:01:30 +0100
committerhorus_arch2015-03-20 01:01:30 +0100
commit039fb0ce71d132a1dfe93b516bc5953dcb61285e (patch)
tree0680bf2d0d42a7c8f4f5dfe0b579277edfc38198 /domain_test.go
parent77b167ceae8904d827571a0ba7bfa13fac28a40e (diff)
downloadfreemail-039fb0ce71d132a1dfe93b516bc5953dcb61285e.tar.gz
Bundling functionality in server.go and improving code flow.
Diffstat (limited to 'domain_test.go')
-rw-r--r--domain_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/domain_test.go b/domain_test.go
index d9dbb0c..6f90ede 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -40,3 +40,17 @@ func TestValidateDomain(t *testing.T) {
t.Fatal("'" + d.Name + "' is a valid domain.")
}
}
+
+func TestGetDomain(t *testing.T) {
+ domain := GetDomain("foo@example.org")
+ if domain != "example.org" {
+ t.Fatal("Can't get the domain from the adress.")
+ }
+}
+
+func TestGetPrimaryKey(t *testing.T) {
+ d := VirtualDomain{Name: "example.org"}
+ if d.GetPrimaryKey() != 1 {
+ t.Fatal("Primary key should be 1.")
+ }
+}