private static void CreateTestSolution() { // First we create a basic solution with some sample items SolutionRepository SR = new SolutionRepository(); //string TempRepositoryFolder = TestResources.getGingerUnitTesterTempFolder(@"Solutions\SRTestTemp"); if (Directory.Exists(TempRepositoryFolder)) { Directory.Delete(TempRepositoryFolder, true); } // Define the items types we want in our Repository SR.AddItemInfo <MyRepositoryItem>("*.Ginger.MyRepositoryItem.xml", @"~\MyRepositoryItems", true, "My Repository Item", PropertyNameForFileName: nameof(MyRepositoryItem.Name)); SR.CreateRepository(TempRepositoryFolder); SR.Open(TempRepositoryFolder); MyRepositoryItem A1 = new MyRepositoryItem("A1"); SR.AddRepositoryItem(A1); MyRepositoryItem A2 = new MyRepositoryItem("A2"); SR.AddRepositoryItem(A2); MyRepositoryItem A3 = new MyRepositoryItem("A3"); SR.AddRepositoryItem(A3); RepositoryFolder <MyRepositoryItem> MyRepoRF = SR.GetRepositoryItemRootFolder <MyRepositoryItem>(); RepositoryFolder <MyRepositoryItem> SubFolder1 = (RepositoryFolder <MyRepositoryItem>)MyRepoRF.AddSubFolder("SubFolder1"); MyRepoRF.AddSubFolder("EmptySubFolder"); MyRepositoryItem A4 = new MyRepositoryItem("A4"); SubFolder1.AddRepositoryItem(A4); // Folder to delete later MyRepoRF.AddSubFolder("SubFolderForDelete"); // Create folders tree RepositoryFolder <MyRepositoryItem> SF1 = (RepositoryFolder <MyRepositoryItem>)MyRepoRF.AddSubFolder("SF1"); RepositoryFolder <MyRepositoryItem> SF2 = (RepositoryFolder <MyRepositoryItem>)SF1.AddSubFolder("SF1_SF2"); RepositoryFolder <MyRepositoryItem> SF3 = (RepositoryFolder <MyRepositoryItem>)SF2.AddSubFolder("SF1_SF2_SF3"); MyRepositoryItem BF5 = new MyRepositoryItem("A5"); SubFolder1.AddRepositoryItem(BF5); MyRepositoryItem BF6 = new MyRepositoryItem("A6"); SF3.AddRepositoryItem(BF6); //TODO: add more sample items for testing SR.Close(); }
private static void CreateTestSolution() { // First we create a basic solution with some sample items SolutionRepository SR = new SolutionRepository(); string TempRepositoryFolder = TestResources.getGingerUnitTesterTempFolder(@"Solutions\SRTestTemp"); if (Directory.Exists(TempRepositoryFolder)) { Directory.Delete(TempRepositoryFolder, true); } SR = Ginger.App.CreateGingerSolutionRepository(); SR.Open(TempRepositoryFolder); ProjEnvironment E1 = new ProjEnvironment() { Name = "E1" }; SR.AddRepositoryItem(E1); //RepositoryFolder<MyRepositoryItem> BFRF = SR.GetRepositoryItemRootFolder<MyRepositoryItem>(); //RepositoryFolder<MyRepositoryItem> SubFolder1 = (RepositoryFolder<MyRepositoryItem>)BFRF.AddSubFolder("SubFolder1"); //BFRF.AddSubFolder("EmptySubFolder"); //MyRepositoryItem BF4 = new MyRepositoryItem("A4"); //SubFolder1.AddRepositoryItem(BF4); //// Folder to delete later //BFRF.AddSubFolder("SubFolderForDelete"); //// Create folders tree //RepositoryFolder<MyRepositoryItem> SF1 = (RepositoryFolder<MyRepositoryItem>)BFRF.AddSubFolder("SF1"); //RepositoryFolder<MyRepositoryItem> SF2 = (RepositoryFolder<MyRepositoryItem>)SF1.AddSubFolder("SF1_SF2"); //RepositoryFolder<MyRepositoryItem> SF3 = (RepositoryFolder<MyRepositoryItem>)SF2.AddSubFolder("SF1_SF2_SF3"); //MyRepositoryItem BF5 = new MyRepositoryItem("A5"); //SubFolder1.AddRepositoryItem(BF5); //MyRepositoryItem BF6 = new MyRepositoryItem("A6"); //SF3.AddRepositoryItem(BF6); //TODO: add more sample items for testing SR.Close(); }
private static void CreateTestSolution() { // First we create a basic solution with some sample items SolutionRepository SR = new SolutionRepository(); string TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions\" + solutionName); if (Directory.Exists(TempRepositoryFolder)) { Directory.Delete(TempRepositoryFolder, true); } SR = GingerSolutionRepository.CreateGingerSolutionRepository(); SR.Open(TempRepositoryFolder); SR.Close(); }
private static void CreateTestSolution() { string sourceFolder = TestResources.GetTestResourcesFolder(@"Solutions\ReportSR"); solutionFolder = TestResources.GetTestTempFolder(@"Solutions\ReportSR"); if (Directory.Exists(solutionFolder)) { Directory.Delete(solutionFolder, true); } CopyDir.Copy(sourceFolder, solutionFolder); SolutionRepository SR = new SolutionRepository(); SR = Ginger.App.CreateGingerSolutionRepository(); SR.Open(solutionFolder); SR.Close(); }
private static void CreateTestSolution() { // First we create a basic solution with some sample items SolutionRepository SR = new SolutionRepository(); if (Directory.Exists(TempRepositoryFolder)) { Directory.Delete(TempRepositoryFolder, true); } // Define the items types we want in our Repository SR.AddItemInfo <MyRepositoryItem>(pattern: "*.Ginger.MyRepositoryItem.xml", // Need to use for file name rootFolder: SolutionRepository.cSolutionRootFolderSign + "MyRepositoryItems", containRepositoryItems: true, displayName: "My Repository Item", PropertyNameForFileName: nameof(MyRepositoryItem.Name) ); SR.CreateRepository(TempRepositoryFolder); SR.Open(TempRepositoryFolder); MyRepositoryItem A1 = new MyRepositoryItem("A1"); SR.AddRepositoryItem(A1); MyRepositoryItem A2 = new MyRepositoryItem("A2"); SR.AddRepositoryItem(A2); MyRepositoryItem A3 = new MyRepositoryItem("A3"); SR.AddRepositoryItem(A3); RepositoryFolder <MyRepositoryItem> MyRepoRF = SR.GetRepositoryItemRootFolder <MyRepositoryItem>(); RepositoryFolder <MyRepositoryItem> SubFolder1 = (RepositoryFolder <MyRepositoryItem>)MyRepoRF.AddSubFolder("SubFolder1"); MyRepoRF.AddSubFolder("EmptySubFolder"); MyRepositoryItem A4 = new MyRepositoryItem("A4"); SubFolder1.AddRepositoryItem(A4); // Folder to delete later MyRepoRF.AddSubFolder("SubFolderForDelete"); // Create folders tree RepositoryFolder <MyRepositoryItem> SF1 = (RepositoryFolder <MyRepositoryItem>)MyRepoRF.AddSubFolder("SF1"); RepositoryFolder <MyRepositoryItem> SF2 = (RepositoryFolder <MyRepositoryItem>)SF1.AddSubFolder("SF1_SF2"); RepositoryFolder <MyRepositoryItem> SF3 = (RepositoryFolder <MyRepositoryItem>)SF2.AddSubFolder("SF1_SF2_SF3"); MyRepositoryItem BF5 = new MyRepositoryItem("A5"); SubFolder1.AddRepositoryItem(BF5); MyRepositoryItem BF6 = new MyRepositoryItem("A6"); SF3.AddRepositoryItem(BF6); RepositoryFolder <MyRepositoryItem> bigFolder = (RepositoryFolder <MyRepositoryItem>)MyRepoRF.AddSubFolder("BigfolderWith100Items"); // Add another 100 big item so it will take time loading and we can check multi thread access while load in progress for (int i = 0; i < 100; i++) { MyRepositoryItem bigItem = new MyRepositoryItem("Big Item #" + i); bigItem.BigStringHolderSlowSet = new string('a', 150000); bigFolder.AddRepositoryItem(bigItem); } //TODO: add more sample items for testing SR.Close(); }
private static void CreateTestSolution() { // First we create a basic solution with some sample items SolutionRepository SR = new SolutionRepository(); if (Directory.Exists(TempRepositoryFolder)) { Directory.Delete(TempRepositoryFolder, true); } // Define the items types we want in our Repository //SR.AddItemInfo<MyRepositoryItem>("*.Ginger.MyRepositoryItem.xml", @"~\MyRepositoryItems", true, "My Repository Item", addToRootFolders: true, PropertyNameForFileName: nameof(MyRepositoryItem.Name)); SR.AddItemInfo <MyRepositoryItem>(pattern: "*.Ginger.MyRepositoryItem.xml", // Need to use for file name rootFolder: SolutionRepository.cSolutionRootFolderSign + "MyRepositoryItems", containRepositoryItems: true, displayName: "My Repository Item", PropertyNameForFileName: nameof(MyRepositoryItem.Name) ); SR.CreateRepository(TempRepositoryFolder); SR.Open(TempRepositoryFolder); MyRepositoryItem A1 = new MyRepositoryItem("A1"); SR.AddRepositoryItem(A1); MyRepositoryItem A2 = new MyRepositoryItem("A2"); SR.AddRepositoryItem(A2); MyRepositoryItem A3 = new MyRepositoryItem("A3"); SR.AddRepositoryItem(A3); RepositoryFolder <MyRepositoryItem> MyRepoRF = SR.GetRepositoryItemRootFolder <MyRepositoryItem>(); RepositoryFolder <MyRepositoryItem> SubFolder1 = (RepositoryFolder <MyRepositoryItem>)MyRepoRF.AddSubFolder("SubFolder1"); MyRepoRF.AddSubFolder("EmptySubFolder"); MyRepositoryItem A4 = new MyRepositoryItem("A4"); SubFolder1.AddRepositoryItem(A4); // Folder to delete later MyRepoRF.AddSubFolder("SubFolderForDelete"); // Create folders tree RepositoryFolder <MyRepositoryItem> SF1 = (RepositoryFolder <MyRepositoryItem>)MyRepoRF.AddSubFolder("SF1"); RepositoryFolder <MyRepositoryItem> SF2 = (RepositoryFolder <MyRepositoryItem>)SF1.AddSubFolder("SF1_SF2"); RepositoryFolder <MyRepositoryItem> SF3 = (RepositoryFolder <MyRepositoryItem>)SF2.AddSubFolder("SF1_SF2_SF3"); MyRepositoryItem BF5 = new MyRepositoryItem("A5"); SubFolder1.AddRepositoryItem(BF5); MyRepositoryItem BF6 = new MyRepositoryItem("A6"); SF3.AddRepositoryItem(BF6); //TODO: add more sample items for testing SR.Close(); }