Example #1
0
File: Test.cs Project: ar9508/CS350
        private void Export_Data_Test(List <Person> p_list, List <Friend> f_list, List <Post> pst_list)
        {
            Add_Persons_To_List();

            Add_Friend_To_List();

            Add_Post_To_List();

            List <object> obj = p_list.Cast <object>().ToList();

            System_Mod test = new System_Mod();

            test.Export_Data(p_list, f_list, pst_list);

            string path = test.Get_Desktop_Path() + "\\Person.txt";

            if (File.Exists(path))
            {
                Data_Store.system_mod_test_results[1] = "Pass";
            }
            else
            {
                Data_Store.system_mod_test_results[1] = "Fail";
            }
        }
Example #2
0
File: Test.cs Project: ar9508/CS350
        private void Import_Data_Test()
        {
            System_Mod test = new System_Mod();

            test.Reset_All_Data();

            test.Import_Data();

            if (Data_Store.posts_list.Count == 4)
            {
                Data_Store.system_mod_test_results[2] = "Pass";
            }
            else
            {
                Data_Store.system_mod_test_results[2] = "Fail";
            }
        }
Example #3
0
File: Test.cs Project: ar9508/CS350
        private void Reset_All_Data_Test()
        {
            Add_Persons_To_List();

            Add_Friend_To_List();

            Add_Post_To_List();

            int[] beforeCount = new int[3];

            beforeCount[0] = Data_Store.person_list.Count();

            beforeCount[1] = Data_Store.friends_list.Count();

            beforeCount[2] = Data_Store.posts_list.Count();

            System_Mod test = new System_Mod();

            test.Reset_All_Data();

            int[] afterCount = new int[3];

            afterCount[0] = Data_Store.person_list.Count();

            afterCount[1] = Data_Store.friends_list.Count();

            afterCount[2] = Data_Store.posts_list.Count();


            for (int i = 0; i < 3; i++)
            {
                if (beforeCount[i] != afterCount[i])
                {
                    Data_Store.system_mod_test_results[0] = "Pass";
                }
                else
                {
                    Data_Store.system_mod_test_results[0] = "Fail";
                }
            }
        }