Beispiel #1
0
 private void AddSteps(ExcelWorksheet xlWorkSheet, ITestAction testAction, Dictionary<string, string> replacements, ref int row)
 {
     var testStep = testAction as ITestStep;
     var group = testAction as ITestActionGroup;
     var sharedRef = testAction as ISharedStepReference;
     if (null != testStep)
     {
         CleanupText(xlWorkSheet.Cells[row, 3], testStep.Title.ToString(), replacements);
         CleanupText(xlWorkSheet.Cells[row, 5], testStep.ExpectedResult.ToString(), replacements);
     }
     else if (null != group)
     {
         foreach (var action in group.Actions)
         {
             AddSteps(xlWorkSheet, action, replacements, ref row);
         }
     }
     else if (null != sharedRef)
     {
         var step = sharedRef.FindSharedStep();
         foreach (var action in step.Actions)
         {
             AddSteps(xlWorkSheet, action, replacements, ref row);
         }
     }
     row++;
 }
Beispiel #2
0
 private static void AssertErrors(ITestAction[] actions, string actionName, string condition = "") {
     if (!actions.Any()) {
         Assert.Fail(string.Format("No Action named '{0}'{1}", actionName, condition));
     }
     if (actions.Count() > 1) {
         Assert.Fail(string.Format("{0} Actions named '{1}' found{2}", actions.Count(), actionName, condition));
     }
 }
Beispiel #3
0
        public virtual void TestTooFewParms()
        {
            ITestObject obj = NewTestObject <Object1>();

            ITestAction a1 = obj.GetAction("Do Something");

            try {
                ITestObject res = a1.InvokeReturnObject();
                Assert.Fail("expect exception");
            } catch (Exception expected) {
                Assert.AreEqual("Assert.IsTrue failed. Action 'Do Something' is unusable: wrong number of parameters, got 0, expect 2", expected.Message);
            }
        }
Beispiel #4
0
 private static int SortByTargetDescending(ITestAction x, ITestAction y)
 {
     return y.Targets.CompareTo(x.Targets);
 }
Beispiel #5
0
 /// <summary>
 /// Construct a TestActionItem
 /// </summary>
 /// <param name="action">The ITestAction to be included</param>
 public TestActionItem(ITestAction action)
 {
     _action = action;
 }
 // ReSharper disable UnusedParameter.Local
 private static void AssertErrors(ITestAction[] actions, string actionName, string condition = "") {
     // ReSharper restore UnusedParameter.Local
     if (!actions.Any()) {
         Assert.Fail("No Action named '{0}'{1}", actionName, condition);
     }
     if (actions.Count() > 1) {
         Assert.Fail("{0} Actions named '{1}' found{2}", actions.Count(), actionName, condition);
     }
 }
Beispiel #7
0
 public void Cleanup() {
     CleanupNakedObjectsFramework();
     foo1 = null;
     prop1 = null;
     act1 = null;
 }
Beispiel #8
0
 public void Initialize() {
     InitializeNakedObjectsFramework();
     foo1 = GetTestService("Foos").GetAction("New Instance").InvokeReturnObject();
     prop1 = foo1.GetPropertyByName("Prop1");
     act1 = foo1.GetAction("Act1");
 }