This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package tdd; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| /** | |
| * Created by mauricioaniche on 26/05/2017. | |
| */ | |
| public class RomanConverter { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package nl.tudelft.mocks2; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class InvoiceFilter { | |
| private InvoiceDao invoiceDao; | |
| private Webservice webservice; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package nl.tudelft.mocks; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Queue; | |
| public class InvoiceFilter { | |
| private InvoiceDao invoiceDao; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package nl.tudelft.mocks; | |
| public class Invoice { | |
| private String customer; | |
| private double value; | |
| public Invoice(String customer, double value) { | |
| this.customer = customer; | |
| this.value = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class X{ | |
| public void x() { | |
| assertEquals("Frodo", frodo.getName()); | |
| assertNotEquals(frodo, sauron); | |
| assertThat(frodo.getName()).isEqualTo("Frodo"); | |
| assertThat(frodo).isNotEqualTo(sauron); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineExecutionListener | |
| at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:53) | |
| at com.intellij.junit5.JUnit5IdeaTestRunner.createListeners(JUnit5IdeaTestRunner.java:39) | |
| at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:49) | |
| at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) | |
| at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) | |
| Caused by: java.lang.ClassNotFoundException: org.junit.platform.engine.EngineExecutionListener | |
| at java.net.URLClassLoader.findClass(URLClassLoader.java:381) | |
| at java.lang.ClassLoader.loadClass(ClassLoader.java:424) | |
| at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Palindrome { | |
| public int count(String word) { | |
| return count(word.replace(" ", "").toUpperCase(), 0); | |
| } | |
| private int count(String word, int acc) { | |
| if(word.isEmpty()) return acc; | |
| if(word.length() == 1) return acc+1; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.Stream; | |
| public class TesteMap { | |
| public static void main(String[] args) { | |
| List<Integer> nums = new ArrayList<Integer>(); | |
| for(int i = 0; i < 50; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 703: $query = "SELECT b.id FROM ".$bean->getTableName()." b LEFT JOIN aod_indexevent ie ON (ie.record_id = b.id AND ie.record_module = '".$beanModule."') WHERE b.deleted = 0 AND (ie.id IS NULL OR ie.date_modified < b.date_modified) ORDER BY b.date_modified ASC"; | |
| 148: $query = "SELECT filename name FROM document_revisions INNER JOIN documents ON documents.id = document_revisions.document_id "; | |
| 210: $q2="select * from email_addr_bean_rel eabr WHERE eabr.bean_id = '".$this->db->quote($id)."' AND eabr.bean_module = '".$this->db->quote($module)."' and eabr.deleted=0"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CustomerServiceTest{ | |
| @Test | |
| public void shouldGenerateInvoices() { | |
| // mocking CustomerDAO | |
| CustomerDAO customerDao = Mockito.mock(CustomerDAO.class); | |
| Mockito.when( | |
| customerDao.findCustomerById(1)) | |
| .thenReturn(new Customer(1, "Customer1")); | |
| // instantiating the CUT, and passing |