Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding 2 test cases #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/palindrom/
Binary file modified bin/palindrom/palindromTest.class
Binary file not shown.
11 changes: 11 additions & 0 deletions untest/palindrom/AllTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package palindrom;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({ Palin_test_1.class, palindromTest.class })
public class AllTests {

}
34 changes: 34 additions & 0 deletions untest/palindrom/Palin_test_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package palindrom;

import static org.junit.Assert.*;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

public class Palin_test_1 {

@Test
public void test() {
//fail("Not yet implemented");
}

@BeforeClass
public static void beforeClass(){
System.out.println("Before PalindromTest.class1");
}
@AfterClass

public static void AfterClass(){
System.out.println("After PalindromTest.class1");
}

public void testIsPal() {

palindrom test = new palindrom();
assertTrue(test.isPal(1221));
for(int i=0;i<10;i++)
assertFalse(test.isPal(i));
}

}
62 changes: 31 additions & 31 deletions untest/palindrom/palindromTest.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
package palindrom;
import static org.junit.Assert.*;
import org.junit.*;
public class palindromTest {
@BeforeClass
public static void beforeClass(){
System.out.println("Before PalindromTest.class");
}
@AfterClass
public static void AfterClass(){
System.out.println("After PalindromTest.class");
}
@Before
public void initTest(){
}
@Test
public void testIsPal() {
palindrom test = new palindrom();
assertTrue(test.isPal(1221));
for(int i=0;i<10;i++)
assertFalse(test.isPal(i));
}
}
package palindrom;

import static org.junit.Assert.*;

import org.junit.*;


public class palindromTest {

@BeforeClass
public static void beforeClass(){
System.out.println("Before PalindromTest.class");
}
@AfterClass

public static void AfterClass(){
System.out.println("After PalindromTest.class");
}
@Before
public void initTest(){

}
@Test
public void testIsPal() {

palindrom test = new palindrom();
assertTrue(test.isPal(1221));
for(int i=0;i<100;i++)
assertFalse(test.isPal(i));
}
}