Coder Social home page Coder Social logo

junitin28minutes's Introduction

JUnitIn28Minutes

Git hub repository for the free Udemy course : https://www.udemy.com/course/junit-tutorial-for-beginners-with-java-examples/

Get started with Junit

Topics

Section 1 Foundation

  • What is JUnit?
  • Why Unit Testing?

Section 2 First JUnit Example

@Test Annotation

  • Running JUnit
  • No Failure = Success
  • Basic Assert methods

Section 3 Second JUnit Example

  • assertTrue and assertFalse methods
  • @Before @After annotations
  • @BeforeClass @AfterClass annotations

Section 4 JUnit Simple Test Scenarios

  • Comparing Arrays
  • Testing Exceptions
  • Performance Unit Tests

Section 5 JUnit Intermediate Test Scenarios

  • Parameterized Tests
  • Test Suites

Section 6 JUnit Best Practices

  • Naming Test Methods
  • Highlight Important Values in Tests
  • Handle Exceptions Properly
  • Readable Assert Statements

Starting Examples

package com.in28minutes.junit.helper;

public class StringHelper {

	public String truncateAInFirst2Positions(String str) {
		if (str.length() <= 2)
			return str.replaceAll("A", "");

		String first2Chars = str.substring(0, 2);
		String stringMinusFirst2Chars = str.substring(2);

		return first2Chars.replaceAll("A", "") 
				+ stringMinusFirst2Chars;
	}

	public boolean areFirstAndLastTwoCharactersTheSame(String str) {

		if (str.length() <= 1)
			return false;
		if (str.length() == 2)
			return true;

		String first2Chars = str.substring(0, 2);

		String last2Chars = str.substring(str.length() - 2);

		return first2Chars.equals(last2Chars);
	}

}

About in28Minutes

  • At in28Minutes, we ask ourselves one question everyday. How do we create more effective trainings?
  • We use Problem-Solution based Step-By-Step Hands-on Approach With Practical, Real World Application Examples.
  • Our success on Udemy and Youtube (2 Million Views & 12K Subscribers) speaks volumes about the success of our approach.
  • While our primary expertise is on Development, Design & Architecture Java & Related Frameworks (Spring, Struts, Hibernate) we are expanding into the front-end world (Bootstrap, JQuery, Angular JS).

Our Beliefs

  • Best Course are interactive and fun.
  • Foundations for building high quality applications are best laid down while learning.

Our Approach

  • Problem Solution based Step by Step Hands-on Learning
  • Practical, Real World Application Examples.
  • We use 80-20 Rule. We discuss 20% things used 80% of time in depth. We touch upon other things briefly equipping you with enough knowledge to find out more on your own.
  • We will be developing a demo application in the course, which could be reused in your projects, saving hours of your effort.
  • All the code is available on Github, for most steps.

About in28Minutes

At in28Minutes, we ask ourselves one question everyday

How do we create more amazing course experiences? We use 80-20 Rule. We discuss 20% things used 80% of time in depth.

We are creating amazing learning experiences for learning Spring Boot with AWS, Azure, GCP, Docker, Kubernetes and Full Stack. 300,000 Learners rely on our expertise. Find out more....

in28MinutesLearningRoadmap-July2019.png

junitin28minutes's People

Contributors

in28minutes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.