No es.... Mockito - Mockito es una librería Java para la creación de Mock Object. - Muy usados para el testeo unitario en Test Driven Development,

Slides:



Advertisements
Presentaciones similares
El imperfecto Los verbos -ER/-IR.
Advertisements

Español 1 Capítulo 11 Página 366
P. 330 Realidades 1 Pensar, Querer, and Preferir By: Sra. Suzanne M. Shirley North Intermediate High School 808 East College, Broken Arrow, OK
Spanish 2 Test 2 Review.
Los verbos estar y ser “to be”
LA GRAM ÁTICA EN ACCIÓN 2 THE VERB GUSTAR, ¿POR QUÉ?, PORQUE, AND DE ¿Por qué? Porque es tu cumplea ños. A e llos les gustan las fiestas. Me gusta mucho.
Infinitive Er- Ir- Verbs (Subjunctive) Por: Nate, Maria, Taylor.
Unit Testing with Mock Objects Angel Núñez / snahider.blogspot.com.
HAZLO AHORA Make a chart in which you write down ALL the pronouns in Spanish and English.
Los verbos regulares – ar What is an infinitive? An infinitive in both Spanish and English is the base form of the verb. In English, the infinitive.
Test Driven Development
Pensar, Querer, and Preferir PREFERIR n Here we will learn the verb PREFERIR, which means “to prefer.” n But before we do, let’s look at 2 other verbs.
Starter: stars and wishes. Learning objectives: To use a writing frame to construct new language and memory strategies to remember it Outcome: Approximately.
Mock objects Rosemary Torrico Bascopé. Introducción Las Pruebas de unidad han sido aceptadas como la “mejor práctica” para el desarrollo de software.
Capítulo 7A Pensar, Querer, and Preferir PREFERIR n Here we will learn the verb PREFERIR, which means “to prefer.” n But before we do, let’s look at.
Expresiones para la clase Commonly used requests and instructions in the classroom el 27 de febrero.
Test-Driven Development Juan Carlos Olivares Rojas MSN:
Hoy es miércoles. La fecha es el 15 de enero LA PREGUNTA: What are the two steps of verb conjugation? LA TAREA y OTROS ANUNCIOS:  Midterm Exam –el 22.
Para hacer ahora 1) There are three types of verbs in Spanish. What are they? 2) How do you determine if a verb is an –ar, -er or –ir verb? 3) What steps.
3B. ¿Quién estás siguiendo en twitter? Yo estoy siguiendo a _______.
 For the three verb note slides, combine two vocabulary words with the specified structure to create a complete Spanish sentence. 1 for each step  Each.
Superlatives Page 400 Superlatives  In English, Superlatives are when we use adjectives with an “est” as a suffix.  For example, the fastest runner,
Indirect object pronouns. En el centro comercial o el mercado Vas de compras para comprar unos regalos para tu familia y tus amigos. Usa oraciones completas.
Los verbos Tener y Venir. Antes de empezar… Some verbs are IRREGULAR, which means that they do not follow the “rules” or patterns that we have talked.
Conocer - to know. Use ‘conocer’ to talk about people, places, and things that you are familiar with.
Gustar vs. Encantar Gustar means “to like” and encantar means “to love”, but these English meanings can cause confusion.
El futuro What is the future tense? When would you use it?
Direct Object Pronouns A direct object tells who or what receives the action of the verb: I see the dog. (I see what? - - the dog = d.o.) I see Mary. (I.
What happens if you want to have both direct and indirect object pronouns in the same sentence? The indirect object goes first. We bought the shirts.
Tener & tener que + infinitive. tener-to have tengotenem os tienestenéis tienetienen 1.They have 2.You (for.) have 3.She has 4.I have 5.We have Look at.
¿Qué recuerdas de español 1 y 2? Español 3. Nivel: español 1 ¿Cómo te llamas? ¿Cómo estás hoy? ¿Cómo eres tú? ¿Cuál es la fecha de hoy? ¿Qué hora es?
INDIRECT OBJECT PRONOUNS Gustar, Interesar, Aburrir.
Las clases de Sra. Schwarz Realidades 1 The Verb IR.
 Requisitos Capturar, definir y validar los casos de uso Realizar los casos de uso Verificar que se satisfacen los casos.
The Present Tense of tener (to have) (El tiempo presente del verbo tener)
ER/IR verb conjugations. Do you remember how to conjugate “ar” verbs? Review with “cantar”… Yo Tú Él/Ella/Usted Nosotros/Nosotras Ellos/Ellas/Ustedes.
Copy the white notes.  There are three types of verbs in the Spanish language. Verbs that end in –ar, -er, and –ir  Example: hablar, comer, escribir.
Notes on Estar. The Verb Estar The AR verbs you have used until now are called regular verbs because they follow a regular pattern -o-amos -asx -a-an.
Lección 3: La familia Please translate into Spanish: turkey: el pavo / el guajolote the snow: la nieve the movie: la películas new: nuevo/a 1.I like to.
Deber Should/ought to. Deber We use “deber” to say what people should do. We conjugate “deber” and then use an infinitive of another verb. Subject + deber.
Foreign Language Teaching Tips Rich Bradshaw. ¡Classroom Vocabulary Scavenger Hunt! Purpose Introduce new vocabulary words in TL Identify items using.
C VERBOS DE BOTA Español 2. Verbos de bota Boot verbs are also known as _______________________. Why? Because the stem changes in the shape of a boot!
C APITULO 2 Gustar, Encantar, Interesar. G USTAR = TO LIKE / TO BE PLEASING TO There are only two conjugations for the verb gustar. GustaGustan The words.
Nicky Jam – El perdón Act. 1 p. 120 (WAV) Think of five chores you do at home. Then, write whether you like or don’t like doing them using me gusta and.
P. 330 Realidades 1 Pensar, Querer, and Preferir.
Mock Objects. Problema Se tiene un administrador de salida de buses en una empresa la cual trabaja en transporte interdepartamental, este administrador.
Hoy es martes, el seis de mayo. La Meta: ¿A quién hablas? Hagan Ahora: Saquen la tarea del viernes para repasarla. (Take out Friday’s homework to go over.
TDD en Python Javier Andrés Mansilla - Except Test Driven Development.
Pruebas de Funcionalidad de Software: Caja Negra y Caja Blanca Curso: Diseño de Sistemas 9no. Semestre.
MAVEN: Introducción.
El verbo “estar” el 25 de marzo.
Repaso D Los deportes y los verbos de cambio radical
Final Exam Topics Present tense conjugations Regular and irregular
In Lección 1, you learned how to conjugate and use the verb ser (to be). You will now learn a second verb which means to be, the verb estar. Although.
Apuntes: Gustar Lección 2: En la clase.
Test Driven Development
Stem Change Verbs.
Taller de desarrollo en gvSIG 2.0
1. WordPress                                      WordPress,     Esta página es la más popular de todas para escribir blogs en Internet. Según las estadísticas.
Ser - To be Soy Somos Sois Eres Son Es -____________ -____________
Estar, Dar, Ver To Be, To Give, To See NP 40.
Pensar, Querer, and Preferir
In Lección 1, you learned how to conjugate and use the verb ser (to be). You will now learn a second verb which means to be, the verb estar. Although.
Expresiones con tener.
Clase25: Listas Enlazadas
HAGAN AHORA: LA HOJA DE TRABAJO
In Lección 1, you learned how to conjugate and use the verb ser (to be). You will now learn a second verb which means to be, the verb estar. Although.
Irregular verbs ir, dar, estar.
Clase25: Listas Enlazadas
Saying which is the best
Transcripción de la presentación:

No es....

Mockito - Mockito es una librería Java para la creación de Mock Object. - Muy usados para el testeo unitario en Test Driven Development, - Basado en EasyMock. - Es OpenSource. disponible en

Características 1. Se pueden crear mocks de interfaces y clases concretas. 2. Verificación de invocaciones (cantidad exacta, al menos una vez, órden de invocación, etc.) 3. El stack trace se mantiene limpio, ya que los errores ocurren en los assert que se hagan (y no dentro del método bajo prueba, como en EasyMock). 4. Un API más clara para crear stubs y verificaciones

No da resaca

Dan North, the originator of BDD "We decided during the main conference that we should use JUnit 4 and Mockito because we think they are the future of TDD and mocking in Java"

Fases // 1. Creación del Mock List mock = mock(List.class); // 2. Descripición del comportamiento esperado when(mock.get(0)).thenReturn("one"); when(mock.get(1)).thenReturn("two"); // 3. Ejecución del método - uso del mock someCodeThatInteractsWithMock(); // 4. Verificación verify(mock).clear();

EasyMock vs Mockito EasyMock List mock = createNiceMock(List.class); expect(mock.get(0)).andStubReturn("o ne"); expect(mock.get(1)).andStubReturn( "two"); mock.clear(); replay(mock); someCodeThatInteractsWithMock(); verify(mock); Mockito List mock = mock(List.class); when(mock.get(0)).thenReturn("one"); when(mock.get(1)).thenReturn("two"); someCodeThatInteractsWithMock(); verify(mock).clear();

Demo Test Carrito de Compras

Demo - Instalación Maven junit 4.9 jar test org.mockito mockito-core rc1 jar test

Demo Agregar un producto al carrito public void agregar(Producto producto){ Item item = items.get(producto); if(item != null){ item.incrementaCantidad(); }else{ Items.put(producto, new Item(producto)); }

Demo 1er Test: Cuando se agrega un producto nuevo se verifica que se esté añadiendo un nuevo item a la public void testAgregaProductoNuevo(){ when(items.get(producto)).thenReturn(null); manager.agregar(producto); verify(items).put((Producto)anyObject(), (Item)anyObject()); }

Demo 2do Test: Cuando se agrega un producto que ya se encuentra en la lista se verifica que se incremente la cantidad para el public void testAgregaProductoRepetitivo(){ when(items.get(any())).thenReturn(item); manager.agregar(producto); verify(item,times(1)).incrementaCantidad(); }

Demo URL :

Follow me! GitHub: Teisen Blog: