Download New Sharecodepoint Android App from Google Play Store : DocScannerPoint : Document Scanner with OCR, PDF: Download Now


Domyhomework123.com - programming homework help. Get your programming homework done with expert homework helper. Trust Writemypaper123.com with your paper and you will never regret it.

Welcome to MyQuestionPoint


Ask Any Question Relative to your Sujbect

Visit: Ask Question


CSE534 : Program in eclipse to create test cases for Sub String - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik

CSE534 : Program in eclipse to create test cases for Sub String - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik
Information about the quality of the software product or service under test.

Program in eclipse to create test cases for Sub String :

SubString.java
package programs;

public class SubStr {
public  boolean subString(String str1,String str2) {
	boolean flag=false;
	for(int i=0;i<str1.length();i++) {
		if(str2.equals(str1.substring(i))) {
			flag=true;
		}
	}
	return flag;
}
}

SubStringTest.java
package programs;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class SubStrTest {
SubStr s;
	@Before
	public void setUp() throws Exception {
	s=new SubStr();}

	@After
	public void tearDown() throws Exception {
	s=null;}

	@Test
	public void test() {
		assertEquals(true,s.subString("welcome", "come"));
		assertEquals(false,s.subString("welcome", "comelo"));
	}

}
About Developer
Aniket Pramanik
I love to make things simple :)

CSE534 : Program in eclipse to create test cases for String Equal - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik

CSE534 : Program in eclipse to create test cases for String Equal - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik
Information about the quality of the software product or service under test.

Program in eclipse to create test cases for String Equal : 

StringEqual.java
package programs;

public class StringEqual {
public boolean strEqual(String str1,String str2) {
	boolean flag=false;
	
	if(str2.equals(str1)){
			flag=true;
		}
	return flag;
}
}

StringEqualTest.java
package programs;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class StringEqualTest {
StringEqual s;
	@Before
	public void setUp() throws Exception {
	s=new StringEqual();}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {
		assertEquals(true,s.strEqual("aniket", "aniket"));
		assertEquals(false,s.strEqual("aniket", "aniketp"));
		assertEquals(false,s.strEqual("aniket","et"));
		assertEquals(false,s.strEqual("welcome", "come"));
	}

}
About Developer
Aniket Pramanik
I love to make things simple :)

CSE534 : Program in eclipse to create test cases for StringConcat - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik

CSE534 : Program in eclipse to create test cases for StringConcat - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik
Information about the quality of the software product or service under test.


 Program in eclipse to create test cases for String Concat

StringConcat.java
package programs;

public class StringConcat {
public String concat(String str1,String str2) {
	String nStr="";
	nStr=str1.concat(str2);
	return nStr;
}
}

StringConcatTest.java
package programs;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class StringConcatTest {
StringConcat str;
	@Before
	public void setUp() throws Exception {
	str=new StringConcat();}

	@After
	public void tearDown() throws Exception {
	str=null;}

	@Test
	public void test() {
		assertEquals("aniketPramanik",str.concat("aniket","Pramanik"));
	}

}
About Developer
Aniket Pramanik
I love to make things simple :)

CSE534 : Program in eclipse to create test cases for Special Char - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik

CSE534 : Program in eclipse to create test cases for Special Char - Software Testing and Quality Assurance laboratory - CSE 534 by Aniket Pramanik
Information about the quality of the software product or service under test.

Program in eclipse to create test cases for Special Char

specialchar.java
package programs;

public class SpecialChar {
public String filter(String x) {
	String str="";
	str=x.replaceAll("[-+^:~!@#$%&()<>]", "");
	System.out.println(str);
	return str;
}
}

specialchartest.java
package programs;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class SpecialCharTest {
SpecialChar x;
	@Before
	public void setUp() throws Exception {
	x=new SpecialChar();}

	@After
	public void tearDown() throws Exception {
	x=null;}

	@Test
	public void test() {
		assertEquals("aniket",x.filter("a#nik-et+"));
	}

}
About Developer
Aniket Pramanik
I love to make things simple :)