1 / 12

Moles Isolation Framework

Moles Isolation Framework. TDD Process. TDD Process. Code. TDD Process. Code. Starea cunoscuta (Known State). Se poate realiza prin : Initializarea / setarea proprietatilor obiectului testat Emularea dependintelor externe (mocking). Starea cunoscuta (Known State).

zalika
Download Presentation

Moles Isolation Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Moles Isolation Framework

  2. TDD Process

  3. TDD Process Code

  4. TDD Process Code

  5. Stareacunoscuta (Known State) • Se poaterealizaprin: • Initializarea/setareaproprietatilorobiectuluitestat • Emulareadependintelorexterne (mocking)

  6. Stareacunoscuta (Known State) • Se poaterealizaprin: • Initializarea/setareaproprietatilorobiectuluitestat • Emulareadependintelorexterne • Mock objects

  7. Stareacunoscuta (Known State) • Se poaterealizaprin: • Initializarea/setareaproprietatilorobiectuluitestat • Emulareadependintelorexterne • Mock objects • Manual • Mock framework (Rhino Mocks, Moq, TypeMock etc.)

  8. Mock objects • Pot “simula” doarce pot inlocui (override): • Interfete • Clase/metodeabstracte • Metodevirtuale • Nu pot “simula”: • Clase/metodestatice • Metode non-virtuale, sealed • Clase sealed • Clase care nu au fostproiectatepentrutestare • Value types

  9. Moles

  10. Moles Isolation Framework • Conceput initial ca parte a PEX • Permiteinlocuireaoricareimetode .NET cu un delegate • Suporta: • Metodestatice • Metode non-virtuale • Value types (de ex. DateTime)

  11. Avantaje/dezavantaje • Avantaje • Se poatesimula (mock) orice tip de date, oricemetodasioriceproprietate • Permiteimplementarea de unit tests in locul integration tests • Permiteabstractizarearesurselorsistem • Dezavantaje • Timpridicat de initializare • Crestemultdimensiunea assembly-ului de test • Daca se intrerupe debugging-ul, procesul host varamanepornit • Schema de naming explicitapoate duce la situatiidificil de citit MDateTime.TryCreateInt32Int32Int32Int32Int32Int32Int32DateTimeOut

  12. Resurse • Moles: http://research.microsoft.com/en-us/projects/moles/ • Proiect & prezentare: • www.byteflux.me

More Related