Skip to content

Commit

Permalink
test(admin): permitted operations
Browse files Browse the repository at this point in the history
  • Loading branch information
alfahami committed May 12, 2024
1 parent 81a2953 commit 629cd74
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Main.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
import lib.FillTables;
import manager.Admin;
import manager.Moderator;
import model.City;

public class Main {

public static void main(String[] args) {

Admin admin = new Admin();
admin.setSession_start();
System.out.println("Admin session start: " + admin.getSession_start());
admin.addCities(FillTables.fillCities());

System.out.println("\n\n" + admin.toString());
System.out.println("Retrieving the city at 3rd position: " + admin.getCity(2).toString());

admin.removeCity(0);
System.out.println("\n\nDeleting the 1st city, it shouldn't appear in the display below: \n\n" + admin.toString());

City retrievedCity = admin.getCity(4);
retrievedCity.setName("Marrakech");
admin.updateCity(4, retrievedCity);
System.out.println("\n\nWe changed the 4th city to Marrakech , below's confirmation: \n\n" + admin.toString());

admin.setSession_end();
System.out.println("\n\nAdmin session end: " + admin.getSession_end());
Moderator modFes = new Moderator();
modFes.setSession_start();
System.out.println("Session start: " + modFes.getSession_start());
System.out.println("\n\nModerator Session start: " + modFes.getSession_start());
modFes.addMembers(FillTables.fillMembers());
modFes.addCards(FillTables.fillCards());

Expand Down

0 comments on commit 629cd74

Please sign in to comment.