void test_isUniversityCollege_given_TARUC_UTAR_request_college_should_return_0(void){

		int result;
		
		InstitutionType type= College;					  

		result = isUniversityCollege (&TARUC, &type);
		TEST_ASSERT_EQUAL ( 0,result);
	
		result = isUniversityCollege (&UTAR, &type);
		TEST_ASSERT_EQUAL ( 0,result);
	
}
Beispiel #2
0
void test_select_institute(){
	InstitutionType instiType = {UniversityCollege};
	Institution institution = {.type=UniversityCollege};
	
	TEST_ASSERT_EQUAL(1, isUniversityCollege(&institution, &instiType) );

}
	List_addTail_Expect(&reversedList, &institution1);

	// Call function
	numberOfElement = Institution_reverse(&list, &reversedList);
	
	TEST_ASSERT_EQUAL(3, numberOfElement);
}

void test_isUniversityCollege_should_return_1_if_same_type() {
	Institution institution1 = {.type = Unknown};
	Institution institution2 = {.type = College};
	
	InstitutionType instType;
	
	instType = Unknown;
	TEST_ASSERT_EQUAL(1, isUniversityCollege(&institution1, &instType));
	
	instType = College;
	TEST_ASSERT_EQUAL(1, isUniversityCollege(&institution2, &instType));
}

void test_isUniversityCollege_should_return_0_if_different_type() {
	Institution institution1 = {.type = Unknown};
	Institution institution2 = {.type = College};
	
	InstitutionType instType = UniversityCollege;
	TEST_ASSERT_EQUAL(0, isUniversityCollege(&institution1, &instType));
	TEST_ASSERT_EQUAL(0, isUniversityCollege(&institution2, &instType));
}

void test_Institution_select_only_select_the_UniversityCollege_type_of_institution() {
	TEST_ASSERT_EQUAL(3, stackCount);
	
}
void test_isUniversityCollege_should_compare_and_return_1_if_Institution_is_the_same_type(){
	int compare;
	Institution Insti[] = {{.type = Unknown},
							{.type = University},
							{.type = UniversityCollege},
							{.type = College}};
							
	InstitutionType type = Unknown;
	InstitutionType type2 = University;
	InstitutionType type3 = UniversityCollege;
	InstitutionType type4 = College;
	
	compare = isUniversityCollege(&Insti[0],&type);
	TEST_ASSERT_EQUAL(1,compare);
	compare = isUniversityCollege(&Insti[1],&type2);
	TEST_ASSERT_EQUAL(1,compare);
	compare = isUniversityCollege(&Insti[2],&type3);
	TEST_ASSERT_EQUAL(1,compare);
	compare = isUniversityCollege(&Insti[3],&type4);
	TEST_ASSERT_EQUAL(1,compare);
}
void test_isUniversityCollege_should_compare_and_return_0_if_Institution_is_the_different_type(){
	int compare;
	Institution Insti[] = {{.type = Unknown},
							{.type = University},
							{.type = UniversityCollege},
							{.type = College}};