european conference Interception and dynamic proxy Interception and

  • Slides: 27
Download presentation
european conference

european conference

Interception and dynamic proxy

Interception and dynamic proxy

Interception and dynamic proxy About me Primož Gabrijelčič http: //primoz. gabrijelcic. org programmer, MVP,

Interception and dynamic proxy About me Primož Gabrijelčič http: //primoz. gabrijelcic. org programmer, MVP, writer, blogger, consultant, speaker Blog http: //thedelphigeek. com Twitter @thedelphigeek Skype gabr 42 Linked. In gabr 42 Git. Hub gabr 42

Interception and dynamic proxy Today’s topics Mocking Unit testing Prototyping Dynamic proxy Delphi as

Interception and dynamic proxy Today’s topics Mocking Unit testing Prototyping Dynamic proxy Delphi as a DSL

Interception and dynamic proxy Mocking

Interception and dynamic proxy Mocking

Interception and dynamic proxy Mocking Dynamic object implementing an interface Pluggable functionality Assertion testing

Interception and dynamic proxy Mocking Dynamic object implementing an interface Pluggable functionality Assertion testing (unit tests)

Interception and dynamic proxy Mock<I> Creation phase. Create Setup phase. Setup Execution phase Call

Interception and dynamic proxy Mock<I> Creation phase. Create Setup phase. Setup Execution phase Call method of I Assertion phase. Received

Interception and dynamic proxy Creation phase uses Spring. Mocking type Intf = interface …

Interception and dynamic proxy Creation phase uses Spring. Mocking type Intf = interface … var mock: Mock<intf> : = Mock<Intf>. Create; mock : = Mock<Intf>. Create(TMock. Behavior. Strict);

Interception and dynamic proxy Setup phase. Setup. Executes([action]). Raises<TException>. Returns<T> . When([condition]). <Intf method>

Interception and dynamic proxy Setup phase. Setup. Executes([action]). Raises<TException>. Returns<T> . When([condition]). <Intf method>

Interception and dynamic proxy Sequences var sequence: Mock. Sequence; . Create(TMock. Behavior. Strict). Setup(Mock.

Interception and dynamic proxy Sequences var sequence: Mock. Sequence; . Create(TMock. Behavior. Strict). Setup(Mock. Sequence). Returns([value 1, value 2, … value. N]) sequence. Completed

Interception and dynamic proxy Parameter matching Arg. Is. Any<T>, . Is. Equal<T>, . Is.

Interception and dynamic proxy Parameter matching Arg. Is. Any<T>, . Is. Equal<T>, . Is. In. Range<T>, . Is. In<T>, . Is. Not. In<T>, . Is. Nil<T>, . Is. Not. Nil<T>, . Is. Regex

Interception and dynamic proxy Specification Multiple rules for the same mocked method Generic first,

Interception and dynamic proxy Specification Multiple rules for the same mocked method Generic first, specific last

Interception and dynamic proxy Assertion phase. Received([times], [match]). <intf method> Times. Any, . At.

Interception and dynamic proxy Assertion phase. Received([times], [match]). <intf method> Times. Any, . At. Least. Once, . At. Most. Once, . Between, . Exactly, . Never, . Once

Interception and dynamic proxy Dynamic proxy

Interception and dynamic proxy Dynamic proxy

Interception and dynamic proxy “ THE REST CLIENT STORY ”

Interception and dynamic proxy “ THE REST CLIENT STORY ”

Interception and dynamic proxy API

Interception and dynamic proxy API

Interception and dynamic proxy RESTClient<API> API

Interception and dynamic proxy RESTClient<API> API

Interception and dynamic proxy RESTClient<API> Http() Https() RESTConnection<API> API

Interception and dynamic proxy RESTClient<API> Http() Https() RESTConnection<API> API

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() Accept. XML Header User.

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() Accept. XML Header User. Agent

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method Accept. XML

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method Accept. XML Header User. Agent

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method Accept. XML

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method Accept. XML Header User. Agent

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method IHTTPResponse Accept.

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method IHTTPResponse Accept. XML Header User. Agent

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method IHTTPResponse Accept.

Interception and dynamic proxy API RESTClient<API> Http() Https() RESTConnection<API> Invoke() API method IHTTPResponse Accept. XML Header User. Agent

Interception and dynamic proxy RESTConnection<API> Invoke()

Interception and dynamic proxy RESTConnection<API> Invoke()

Interception and dynamic proxy RESTConnection<API> Invoke() Spring. Interception TProxy. Generator. Create. Interface. Proxy. Without.

Interception and dynamic proxy RESTConnection<API> Invoke() Spring. Interception TProxy. Generator. Create. Interface. Proxy. Without. Target() TInterface. Proxy implements API

Interception and dynamic proxy RESTConnection<API> Invoke() Spring. Interception TProxy. Generator. Create. Interface. Proxy. Without.

Interception and dynamic proxy RESTConnection<API> Invoke() Spring. Interception TProxy. Generator. Create. Interface. Proxy. Without. Target() TInterface. Proxy implements API method IHTTPResponse TRESTInterceptor Intercept

Interception and dynamic proxy “ THE END ”

Interception and dynamic proxy “ THE END ”