Skip to content
Snippets Groups Projects
Commit 55efbde4 authored by evatarr's avatar evatarr
Browse files

-Need to code saveEverything

-Finished testing and adding more comments
-Unit tests added
parent 1c619d2c
No related branches found
No related tags found
2 merge requests!45Prototype to Master for Milestone 5,!43Feature profiles
......@@ -59,4 +59,89 @@ public class profile {
public void removeHotKey(int id){
HKeys.remove(id);
}
public static void main(String[] args) {
System.out.println("**********TESTING*************");
//Testing for profile class and getName()
String name1 = "Eva";
String name2 = "";
String name3 = "123456";
String name4 = "\n";
String name5 = "Devin";
String name6 = "Buffie";
String name7 = "Terry";
String name8 = "Barb";
String name9 = "Debby";
profile one = new profile(name1);
profile two = new profile(name2);
profile three = new profile(name3);
profile four = new profile(name4);
System.out.println("**********Make profiles*************");
System.out.println(one.getName());
//System.out.println(two.getName()); //Prints out and empty string
System.out.println(three.getName());
//System.out.println(four.getName()); //Prints out a newline character
//Testing for addProfile() and deleteProfile()
addProfile add = new addProfile();
add.AddProfile(name1);
add.AddProfile(name3);
add.AddProfile(name4);
add.AddProfile(name5);
add.AddProfile(name6);
add.AddProfile(name7);
add.AddProfile(name8);
add.AddProfile(name9);
//Set and check active account
System.out.println("**********Set Active*************");
setActive set = new setActive();
set.SetActive(name1);
checkActive check = new checkActive();
System.out.println("Should print out Eva:");
System.out.println(check.CheckActive().getName());
System.out.println("Should print out 123456:");
set.SetActive(name3);
System.out.println(check.CheckActive().getName());
//Change for case where name isn't in our profile database
System.out.println("Change active profile to one that doesn't exist (Should be No Active Profile)");
set.SetActive("Gwen");
System.out.println(check.CheckActive().getName());
//Set active for remainder of check profiles
set.SetActive(name6);
//Print the names of all the profiles
System.out.println("**********Print all profiles*************");
currentProfiles p = new currentProfiles();
String all = p.findAllProfiles();
System.out.println(all);
//Delete a profile and print the results again
System.out.println("**********Delete a profile and print results*************");
System.out.println("Eva should be removed:");
deleteProfile d = new deleteProfile();
d.DeleteProfile(name1);
String allDelete = p.findAllProfiles();
System.out.println(allDelete);
d.DeleteProfile(name7);
String tAndNullDelete = p.findAllProfiles();
System.out.println("Terry should be removed:");
System.out.println(tAndNullDelete);
d.DeleteProfile(name7);
String NullDelete = p.findAllProfiles();
System.out.println("Nothing should be removed:");
System.out.println(NullDelete);
//Hotkey adding, getting and removing testing
System.out.println("**********Add and remove Hotkeys*************");
getHotkey g = new getHotkey();
Hotkey h = g.GetHotkey(name3, 2);
System.out.println(g.getErrorMessage()); //Should print out "Hotkey does not exist in this profile"
removeHotkey r = new removeHotkey();
r.RemoveHotkey("num",3);
System.out.println(r.getErrorMessage()); //Should print out "No profile with name: num"
r.RemoveHotkey(name8,12);
System.out.println(r.getErrorMessage()); //Should print out "This profile does not have a hotkey with id: 12"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment