public void GenerateTestDatabase(int eventCount, int startYear,
                                  bool keepLicenceFile)
 {
     Console.WriteLine(
         "Generating test database in folder " +
         $"'{DatabaseConfig.DefaultDatabaseFolderPath}'.");
     InitialiseDatabase(DatabaseConfig.DefaultDatabaseFolderPath, keepLicenceFile);
     Data = new TestData(new QueryHelper(), startYear);
     Session.BeginUpdate();
     Data.AddActsPersisted(Session);
     Data.AddArtistsPersisted(200, Session);
     Data.AddEventTypesPersisted(Session);
     Data.AddGenresPersisted(Session);
     Data.AddLocationsPersisted(Session);
     Data.AddNewslettersPersisted(eventCount, Session);
     Data.AddRolesPersisted(Session);
     Data.AddSeriesPersisted(Session);
     Data.AddUserOptionsPersisted(3, Session);
     Console.WriteLine($"Adding {eventCount} Events.");
     Data.AddEventsPersisted(eventCount, Session);
     // Console.WriteLine($"{eventCount} Events added. Adding Sets.");
     // AddSets();
     // Console.WriteLine($"{Data.Sets.Count} Sets added. Adding Pieces.");
     // AddPieces();
     // Console.WriteLine($"{Data.Pieces.Count} Pieces added. Adding Credits.");
     // AddCredits();
     // Console.WriteLine($"{Data.Credits.Count} Credits added. Committing.");
     Session.Commit();
     Console.WriteLine(
         $"Finished: {Data.Events.Count:#,0} Events; {Data.Sets.Count:#,0} Sets; " +
         $"{Data.Pieces.Count:#,0} Pieces; {Data.Credits.Count:#,0} Credits.\r\n" +
         $"First Newsletter Date: {Data.FirstNewsletterDate:ddd dd MMM yyyy}\r\n" +
         $"Last Event Date: {Data.LastEventDate:ddd dd MMM yyyy}");
 }
示例#2
0
 public void Setup()
 {
     QueryHelper = new QueryHelper();
     Data        = new TestData(QueryHelper);
     Session     = new TestSession();
     SetComparer = new SetComparer();
     Session.BeginUpdate();
     Data.AddEventTypesPersisted(1, Session);
     Data.AddNewslettersPersisted(1, Session);
     Data.AddSeriesPersisted(1, Session);
     Data.AddActsPersisted(1, Session);
     Data.AddGenresPersisted(1, Session);
     Session.Commit();
 }
 public void Setup()
 {
     QueryHelper = new QueryHelper();
     Data        = new TestData(QueryHelper);
     Session     = new TestSession();
     Session.BeginUpdate();
     Data.AddEventTypesPersisted(2, Session);
     Data.AddLocationsPersisted(2, Session);
     Data.AddActsPersisted(1, Session);
     Data.AddNewslettersPersisted(3, Session);
     Data.AddSeriesPersisted(2, Session);
     Data.AddEventsPersisted(4, Session, Data.Locations[0]);
     Session.Commit();
     List = new EventList {
         QueryHelper = QueryHelper, Session = Session
     };
 }
 public static void AddOneOfEachEntityTypePersisted(
     TestData data, SessionBase session)
 {
     data.AddActsPersisted(1, session);
     data.AddArtistsPersisted(1, session);
     data.AddEventTypesPersisted(1, session);
     data.AddGenresPersisted(1, session);
     data.AddLocationsPersisted(1, session);
     data.AddNewslettersPersisted(1, session);
     data.AddRolesPersisted(1, session);
     data.AddSeriesPersisted(1, session);
     data.AddUserOptionsPersisted(1, session);
     data.AddEventsPersisted(1, session);
     data.AddSetsPersisted(1, session);
     data.AddPiecesPersisted(1, session);
     data.AddCreditsPersisted(1, session);
 }
 public void Setup()
 {
     QueryHelper = new QueryHelper();
     Data        = new TestData(QueryHelper);
     Session     = new TestSession();
     EditorView  = new MockEditorView(new MockMainGrid(), new MockParentGrid());
     CreateControllers(typeof(EventList));
     CellView = new MockView <ComboBoxCellController>();
     Session.BeginUpdate();
     try {
         Data.AddActsPersisted(3, Session);
         Data.AddEventTypesPersisted(1, Session);
         Data.AddLocationsPersisted(2, Session);
         Data.AddNewslettersPersisted(3, Session);
         Data.AddSeriesPersisted(1, Session);
         Data.AddEventsPersisted(5, Session);
     } finally {
         Session.Commit();
     }
     EditorController.Populate(); // Populate grid
 }