SlideShare a Scribd company logo
Reverse a no:
package test;
public class Eval {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
public int reverse(int n)
{
int result = 0;
int rem;
while (n > 0)
{
rem = n % 10;
n = n / 10;
result = result * 10 + rem;
}
return result;
}
}
package test;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class EvalTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@Test
public void testReverse() {
Eval ob=new Eval();
int result1=ob.reverse(123);
assertEquals(321,result1);
}
}

More Related Content

PDF
Testing with Kotlin
PDF
KEY
XpUg Coding Dojo: KataYahtzee in Ocp way
PPTX
MUST CS101 Lab11
PDF
Promises in JavaScript
KEY
Agile Iphone Development
ODP
Software Testing
PPTX
Reactor Design Pattern
Testing with Kotlin
XpUg Coding Dojo: KataYahtzee in Ocp way
MUST CS101 Lab11
Promises in JavaScript
Agile Iphone Development
Software Testing
Reactor Design Pattern

What's hot (19)

PPTX
Unit testing CourseSites Apache Filter
PDF
Rx java testing patterns
KEY
Unit testing en iOS @ MobileCon Galicia
PDF
Python Unit Test
PDF
STAMP ActiveEon Use Case at Telecom Valley Dec. 2018
PDF
Unit test
PDF
Clean code via dependency injection + guice
PPTX
Fine grain process control 2nd nov
PDF
PDF
Unit Testing in Angular(7/8/9) Using Jasmine and Karma Part-2
PDF
The Ring programming language version 1.7 book - Part 85 of 196
PDF
Testing AngularJS
PDF
Unit Testing: Special Cases
PPT
Introduzione al TDD
PDF
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
PDF
Python unittest
PDF
Using OTP and gen_server Effectively
PDF
Practical Fault Tolerance in Elixir - Alexei Sholik
Unit testing CourseSites Apache Filter
Rx java testing patterns
Unit testing en iOS @ MobileCon Galicia
Python Unit Test
STAMP ActiveEon Use Case at Telecom Valley Dec. 2018
Unit test
Clean code via dependency injection + guice
Fine grain process control 2nd nov
Unit Testing in Angular(7/8/9) Using Jasmine and Karma Part-2
The Ring programming language version 1.7 book - Part 85 of 196
Testing AngularJS
Unit Testing: Special Cases
Introduzione al TDD
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Python unittest
Using OTP and gen_server Effectively
Practical Fault Tolerance in Elixir - Alexei Sholik
Ad

Recently uploaded (20)

PDF
Insiders guide to clinical Medicine.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Structure & Organelles in detailed.
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Pre independence Education in Inndia.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Lesson notes of climatology university.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
master seminar digital applications in india
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Insiders guide to clinical Medicine.pdf
Classroom Observation Tools for Teachers
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Structure & Organelles in detailed.
PPH.pptx obstetrics and gynecology in nursing
Pre independence Education in Inndia.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Lesson notes of climatology university.
2.FourierTransform-ShortQuestionswithAnswers.pdf
master seminar digital applications in india
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
STATICS OF THE RIGID BODIES Hibbelers.pdf
Renaissance Architecture: A Journey from Faith to Humanism
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Sports Quiz easy sports quiz sports quiz
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Ad

Reverse123

  • 1. Reverse a no: package test; public class Eval { public static void main(String[] args) { // TODO Auto-generated method stub } public int reverse(int n) { int result = 0; int rem; while (n > 0) { rem = n % 10; n = n / 10; result = result * 10 + rem; } return result; } } package test; import static org.junit.Assert.*; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class EvalTest { @BeforeClass
  • 2. public static void setUpBeforeClass() throws Exception { } @Before public void setUp() throws Exception { } @Test public void testReverse() { Eval ob=new Eval(); int result1=ob.reverse(123); assertEquals(321,result1); } }