From d4087a12e1dccd74c089f2583500578fa5e59212 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 20 Mar 2016 15:14:46 +0000 Subject: [PATCH] Added unit tests for the GetAccountFile function. --- source/tests/xestiaab_common.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h index 7beaa1b..248582e 100644 --- a/source/tests/xestiaab_common.h +++ b/source/tests/xestiaab_common.h @@ -151,4 +151,30 @@ TEST(CommonFunctions, GetAccountDirCertificate){ #endif +} + +TEST(CommonFunctions, GetAccountsFile){ + + // Run the unit tests depending on the operating system being used. + +#if defined(__WIN32__) + +#elif defined(__APPLE__) + +#else + + // Setup for comparison purposes. Should be + // /home//.xestiaab/preferences/accounts + + wxString AccountsFileCheck = ""; + AccountsFileCheck.Clear(); + AccountsFileCheck.Append(wxString::FromUTF8(getenv("HOME"))); + AccountsFileCheck.Append(wxT("/.xestiaab/preferences/accounts")); + + wxString AccountsFile = GetAccountsFile(); + + ASSERT_EQ(AccountsFile, AccountsFileCheck); + +#endif + } \ No newline at end of file -- 2.39.2