public Report(Paper paper) { //copies the common data between reports and papers; this.AID = paper.AID; this.Link = paper.Link; this.UserID = paper.UserID; }
//run the tests -1 is undefined test public int run() { //int changed = 0; //inRestults= getdata(aID); // Create a temp linked list type = 1; string c; LinkedList<string> input = new LinkedList<string>(); c = "this is a test"; input.AddFirst(c); c = "this is a test"; input.AddFirst(c); c = "this is a test"; input.AddFirst(c); Paper x = new Paper(); x.Data = input; x.AID = 2; x.Link = "this is a test link"; x.UserID = "TestUser"; LinkedList<Paper> retrived = new LinkedList<Paper>(); retrived.AddLast(x); LinkedList<Report> output = new LinkedList<Report>(); //LinkedList<Report> oResults=new LinkedList<Report>(); switch (type) { case 1://wc // for each item inRestults LinkedListNode<Paper> currentPaper = retrived.First; while (currentPaper != null) { this.tested++; Report currentReport = new Report(currentPaper.Value); currentReport.TypeID = 1; currentReport.TestID = wc.count(currentPaper.Value.Data); reports.AddLast(currentReport); currentPaper = currentPaper.Next; } break; case 2://keywc // for each item inRestults //String data = kwc.count(item.LL_String); //data.split(:); //report=new report (item.assignid,item.userid,type,data.uuid,item.link //sqlinsert(keywctable(data)) //OResults.add(report); break; case 3://n-word break; case 4://phrased n-word break; default: return -1; } // put results into results tables // changed = sqlinsert(oresults); // number of rows added to the tables return this.tested; }
public void testInit() { type = 1; string c; LinkedList<string> input = new LinkedList<string>(); c = "this is a test"; input.AddFirst(c); c = "this is a test"; input.AddFirst(c); c = "this is a test"; input.AddFirst(c); Paper x = new Paper(); x.Data = input; LinkedList<Paper> retrived = new LinkedList<Paper>(); retrived.AddLast(x); LinkedList<Report> output = new LinkedList<Report>(); }