public void Run() { for (int c = 0; c < this._cases.Count; c++) { if (this._cancelled) { break; } this._currTestCase = c; this._currTest = 0; this._cases[c].Reset(true); this.RaiseProgress(); //Get the Initial Memory Usage allowing the GC to clean up as necessary this._cases[c].InitialMemory = GC.GetTotalMemory(true); //Do this to ensure we've created the Graph instance IGraph temp = this._cases[c].Instance; this.RaiseProgress(); for (int t = 0; t < this._tests.Count; t++) { if (this._cancelled) { break; } this._currTest = t; this.RaiseProgress(); //Run the Test and remember the Results TestResult r = this._tests[t].Run(this._cases[c]); this._cases[c].Results.Add(r); } //Clear URI Factory after Tests to return memory usage to base levels UriFactory.Clear(); } this.RaiseProgress(); if (this._cancelled) { this.RaiseCancelled(); } this._cancelled = false; foreach (TestCase c in this._cases) { c.Reset(false); } }
private void resetEverything(IGraph graphToWrite) { //int nItems = itemsToWrite.Count; //for (int idx = nItems - 1; idx > 0; idx--) //{ // itemsToWrite[idx] = null; //} graphToWrite.Clear(); graphToWrite = null; // itemsToWrite = null; UriFactory.Clear(); GC.Collect(); }