Changeset View
Changeset View
Standalone View
Standalone View
apps/kolab_guam/test/kolab_guam_sup_SUITE.erl
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
% optional, can do function level tear down for all functions, | % optional, can do function level tear down for all functions, | ||||
% or for individual functions by matching on TestCase. | % or for individual functions by matching on TestCase. | ||||
end_per_testcase(_TestCase, Config) -> | end_per_testcase(_TestCase, Config) -> | ||||
Config. | Config. | ||||
% c("apps/kolab_guam/test/kolab_guam_sup_tests.erl"). eunit:test(kolab_guam_sup_tests). | % c("apps/kolab_guam/test/kolab_guam_sup_tests.erl"). eunit:test(kolab_guam_sup_tests). | ||||
imap_server_settings_to_config_test(_TestConfig) -> | |||||
Configs = [ | |||||
{ | |||||
[], | |||||
#eimap_server_config{} | |||||
}, | |||||
{ | |||||
[ { tls, false } ], | |||||
#eimap_server_config{ tls = false } | |||||
}, | |||||
{ | |||||
[ { host, "192.168.56.101" }, { port, 993 }, { tls, true } ], | |||||
#eimap_server_config{ host = "192.168.56.101", port = 993, tls = true } | |||||
} | |||||
], | |||||
lists:foreach(fun({ Config, Record }) -> Record = kolab_guam_sup:imap_server_settings_to_config(Config) end, Configs). | |||||
default_imap_server_config_test(_TestConfig) -> | default_imap_server_config_test(_TestConfig) -> | ||||
Expected = #eimap_server_config{ host = "192.168.56.102", port = 994, tls = true }, | Expected = [ { host, "192.168.56.102" }, { port, 994 }, { tls, true } ], | ||||
Expected = kolab_guam_sup:default_imap_server_config(). | Expected = kolab_guam_sup:default_imap_server_config(). | ||||
imap_server_config_test(_TestConfig) -> | imap_server_config_test(_TestConfig) -> | ||||
Configs = [ | Configs = [ | ||||
{ | { | ||||
test_default, | test_default, | ||||
#eimap_server_config{ host = "192.168.56.101", port = 993, tls = false } | [ { host, "192.168.56.101" }, { port, 993 }, { tls, false } ] | ||||
} | } | ||||
], | ], | ||||
lists:foreach(fun({ Config, Record }) -> Record = kolab_guam_sup:imap_server_config(Config) end, Configs). | lists:foreach(fun({ Config, Record }) -> Record = kolab_guam_sup:imap_server_config(Config) end, Configs). | ||||