Package ar.com.dgarcia.java_verbs.api

Examples of ar.com.dgarcia.java_verbs.api.Verb.apply()


            });

            it("1 argument", ()->{
                Verb verb = Verbs.in("test").asFunction("test", (first) -> context().operation().operationWithReturn(first));

                verb.apply("1");

                verify(context().operation()).operationWithReturn("1");
            });

            it("2 arguments", ()->{
View Full Code Here


            });

            it("2 arguments", ()->{
                Verb verb = Verbs.in("test").asFunction("test", (first, second) -> context().operation().operationWithReturn(first, second));

                verb.apply("1", "2");

                verify(context().operation()).operationWithReturn("1","2");
            });

            it("3 arguments", ()->{
View Full Code Here

            });

            it("3 arguments", ()->{
                Verb verb = Verbs.in("test").asFunction("test", (first, second, third) -> context().operation().operationWithReturn(first, second, third));

                verb.apply("1", "2", "3");

                verify(context().operation()).operationWithReturn("1","2", "3");
            });

            it("4 arguments", ()->{
View Full Code Here

            });

            it("4 arguments", ()->{
                Verb verb = Verbs.in("test").asFunction("test", (first, second, third, fourth, extra) -> context().operation().operationWithReturn(first, second, third, fourth));

                verb.apply("1", "2", "3", "4");

                verify(context().operation()).operationWithReturn("1", "2", "3", "4");
            });

            it("5 or more arguments", ()->{
View Full Code Here

            });

            it("5 or more arguments", ()->{
                Verb verb = Verbs.in("test").asFunction("test", (first, second, third, fourth, extra) -> context().operation().operationWithReturn(first, second, third, fourth, extra[0]));

                verb.apply("1", "2", "3", "4", "5");

                verify(context().operation()).operationWithReturn("1", "2", "3", "4", "5");
            });
        });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.