public void TestDeleteAction(DeletePosition deletePosition) { string firstPath = Path.Combine(TestSupport.CreatedFilesDirectory, "first.xml"); string secondPath = Path.Combine(TestSupport.CreatedFilesDirectory, "second.xml"); TestCasesRootContainer tcrc = new TestCasesRootContainer(); tcrc.TestCasesRoot.Save(firstPath); SelectedValuesByConditionsAndActions selValues = new SelectedValuesByConditionsAndActions(); selValues.CollectValues(tcrc.TestCasesRoot); selValues.Check(tcrc.TestCasesRoot); int indexWhereToDelete = TestUtils.CalculateIndex(tcrc.TestCasesRoot.Actions, deletePosition); int actionCount = tcrc.TestCasesRoot.Actions.Count; tcrc.TestCasesRoot.DeleteActionAt(indexWhereToDelete); TestUtils.CheckTestCasesAndConditionsAndActions(tcrc.TestCasesRoot); Assert.That(actionCount == 3); // adjust last testcase on failue Assert.That(tcrc.TestCasesRoot.Actions.Count == actionCount - 1); Assert.That(tcrc.ConditionChangeCount == 0); Assert.That(tcrc.ActionChangeCount == 2); selValues.DeleteAction(deletePosition); selValues.Check(tcrc.TestCasesRoot); tcrc.TestCasesRoot.Save(secondPath); // only for manual check of testcase //TestSupport.CompareFile(firstPath, secondPath); }
public void DeletePosition(int positionId, Account loginUser) { DeletePosition deletePosition = new DeletePosition(positionId, loginUser); deletePosition.Excute(); }