public override List <GeneralUseStructure> GenerateSequence(List <GeneralUseStructure> listGeneralStructure, ref int tcCount, StructureType type) { GenerateTestPlanDFSforTCC populate = new GenerateTestPlanDFSforTCC(); List <TestPlanForTCC> listPlan = new List <TestPlanForTCC> (); List <GeneralUseStructure> listScript = new List <GeneralUseStructure> (); List <GeneralUseStructure> listSequenceGenerationStructure = base.ConvertStructure(listGeneralStructure, type); //paramFiles = listGeneralStructure.OfType<CsvParamFile>().ToList(); foreach (GeneralUseStructure sgs in listSequenceGenerationStructure) { this.dg = (DirectedGraph)sgs; List <String[]> sequence = this.GenerateTestCases(); testPlan = populate.PopulateTestPlan(sequence, dg); //tcCount += testPlan.TestCases.Count; listPlan.Add(testPlan); } //GeneralTPGenerator(listPlan); foreach (TestPlanForTCC testPlan in listPlan) { GeneralUseStructure sc = (GeneralUseStructure)testPlan; listScript.Add(sc); } //TestCase.contWorkItemId = 1000; return(listScript); }
public override List <GeneralUseStructure> GenerateSequence(List <GeneralUseStructure> listGeneralStructure, ref int tcCount, StructureType type) { //FUNC GenerateTestPlan populate1 = new GenerateTestPlan(); //PERF GenerateTestSuit populate2 = new GenerateTestSuit(); List <TestPlan> listPlan = new List <TestPlan>(); List <GeneralUseStructure> listScript = new List <GeneralUseStructure>(); GeneralUseStructure modelGeneralUseStructure = listGeneralStructure.FirstOrDefault(); List <GeneralUseStructure> listSequenceGenerationStructure = base.ConvertStructure(listGeneralStructure, type); List <TestStep> listTestStep = new List <TestStep>(); foreach (GeneralUseStructure sgs in listSequenceGenerationStructure) { this.fsm = (Lesse.Modeling.FiniteStateMachine.FiniteStateMachine)sgs; String[][] sequence = this.GenerateTestCases(); //Verify what to do in this step when using PerformanceTool List <CsvParamFile> listCSV = listGeneralStructure.OfType <CsvParamFile>().ToList(); //FUNC TestPlan plan = populate1.PopulateTestPlan(sequence, fsm, listCSV); //PERF TestSuit suit = populate2.PopulateTestSuit(sequence, fsm, modelGeneralUseStructure); tcCount += plan.TestCases.Count; plan.NameUseCase = this.fsm.NameUseCase; listPlan.Add(plan); } GeneralTPGenerator(listPlan, listTestStep); foreach (TestPlan testPlan in listPlan) { GeneralUseStructure sc = (TestPlan)testPlan; //sc.NameUseCase = testPlan.NameUseCase; listScript.Add(sc); } return(listScript); }
public TestSuit PopulateTestSuit(String[][] matriz, Plets.Modeling.FiniteStateMachine.FiniteStateMachine machine, GeneralUseStructure modelGeneralUseStructure) { UmlModel model = (UmlModel)modelGeneralUseStructure; foreach (UmlUseCaseDiagram ucDiagram in model.Diagrams.OfType <UmlUseCaseDiagram> ()) { UmlUseCase equivalentUC = ucDiagram.UmlObjects.OfType <UmlUseCase> ().Where(x => x.Name.Equals(machine.Name)).FirstOrDefault(); foreach (UmlActor actor in ucDiagram.UmlObjects.OfType <UmlActor> ()) { foreach (UmlAssociation association in ucDiagram.UmlObjects.OfType <UmlAssociation> ()) { if ((association.End1.Equals(actor) && association.End2.Equals(equivalentUC)) || (association.End1.Equals(equivalentUC) && association.End2.Equals(actor))) { try { actualTestCaseProb = float.Parse(association.GetTaggedValue("TDprob"), CultureInfo.InvariantCulture); } catch { actualTestCaseProb = 0; } if (suit.Scenarios.Count < 1) { scenario = new Scenario(); scenario.Name = actor.Name; AddScenarioInformation(actor); suit.Scenarios.Add(scenario); } foreach (Scenario scenarioAlreadyAdded in suit.Scenarios) { if (actor.Name.Equals(scenarioAlreadyAdded.Name)) { scenario = scenarioAlreadyAdded; } else { scenario = new Scenario(); scenario.Name = actor.Name; AddScenarioInformation(actor); suit.Scenarios.Add(scenario); } } } } } } for (int k = 0; k < matriz.Length; k++) { List <Transition> listTransition = new List <Transition> (); String[] arraySequence = matriz[k]; foreach (String input in arraySequence) { Transition tran = new Transition(); tran = GetTransitionFSM(input, machine); if (tran != null) { listTransition.Add(tran); } } scenario.TestCases.Add(FillTestCase(machine, listTransition)); } return(suit); }