public static void Test <T> (string methodName, TestAction <T> method)
        {
            Console.WriteLine(" se ejecuta el metodo " + methodName + " en la estructura : " + typeof(T).Name);
            bool succes = false;
            T    methodsOut;

            method.Invoke(out succes, out methodsOut);
            Console.WriteLine("se pudo completar la operacion ? " + succes);

            Console.WriteLine("\n");

            Console.ReadLine();
        }
示例#2
0
        public static void Test <T> (string methodName, TestAction <T> method)
        {
            Console.WriteLine("\n" + "------------------- test " + methodName + " --------------------" + "\n");
            Console.WriteLine("Se ejecuta el metodo " + methodName + " en la estructura : " + typeof(T).Name + "\n");
            bool succes = false;
            T    methodsOut;

            method.Invoke(out succes, out methodsOut);
            Console.WriteLine("\n" + "La operacion concluye con exito :" + succes);

            Console.WriteLine("\n" + "------------------- end test --------------------" + "\n");
            Console.ReadLine();
        }
示例#3
0
        public void Invoking_an_allowedaction_should_call_the_correct_override()
        {
            IAllowedAction action = new TestAction();

            var currentPayload = IntegerPayload.New(1);
            var expectedState  = TestState.New("OneMore");
            var expectedValue  = 2;
            var stateChange    = action.Invoke(new ActionRequest <IntegerPayload>("TestAction", currentPayload)).GetStateChange();

            Assert.AreEqual(expectedValue, stateChange.NewPayload.Object);
            Assert.AreEqual(expectedState.CurrentState, stateChange.NewState.CurrentState);
            Assert.AreEqual(1, stateChange.Messages.Count());
            Assert.AreEqual("Happy Path", stateChange.Messages.First());
        }
示例#4
0
 private void btnTest_Click(object sender, EventArgs e)
 {
     TestAction?.Invoke();
 }