From 039fb0ce71d132a1dfe93b516bc5953dcb61285e Mon Sep 17 00:00:00 2001 From: horus_arch Date: Fri, 20 Mar 2015 01:01:30 +0100 Subject: Bundling functionality in server.go and improving code flow. --- domain_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'domain_test.go') 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.") + } +} -- cgit v1.2.3