This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 361d4c17 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

testing

parent a9b7d07e
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -2,6 +2,8 @@ package at.ac.uibk.gitsearch.es.model;
import java.util.List;
import org.codeability.sharing.plugins.api.search.UserProvidedMetadataDTO.Person;
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
......@@ -215,5 +217,104 @@ public class ExerciseInfo {
}
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((contributor == null) ? 0 : contributor.hashCode());
result = prime * result + ((creator == null) ? 0 : creator.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((difficulty == null) ? 0 : difficulty.hashCode());
result = prime * result + ((format == null) ? 0 : format.hashCode());
result = prime * result + ((keyword == null) ? 0 : keyword.hashCode());
result = prime * result + ((language == null) ? 0 : language.hashCode());
result = prime * result + ((license == null) ? 0 : license.hashCode());
result = prime * result + ((metadataVersion == null) ? 0 : metadataVersion.hashCode());
result = prime * result + ((programmingLanguage == null) ? 0 : programmingLanguage.hashCode());
result = prime * result + ((source == null) ? 0 : source.hashCode());
result = prime * result + ((structure == null) ? 0 : structure.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof ExerciseInfo))
return false;
ExerciseInfo other = (ExerciseInfo) obj;
if (contributor == null) {
if (other.contributor != null)
return false;
} else if (!contributor.equals(other.contributor))
return false;
if (creator == null) {
if (other.creator != null)
return false;
} else if (!creator.equals(other.creator))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (difficulty != other.difficulty)
return false;
if (format == null) {
if (other.format != null)
return false;
} else if (!format.equals(other.format))
return false;
if (keyword == null) {
if (other.keyword != null)
return false;
} else if (!keyword.equals(other.keyword))
return false;
if (language == null) {
if (other.language != null)
return false;
} else if (!language.equals(other.language))
return false;
if (license == null) {
if (other.license != null)
return false;
} else if (!license.equals(other.license))
return false;
if (metadataVersion == null) {
if (other.metadataVersion != null)
return false;
} else if (!metadataVersion.equals(other.metadataVersion))
return false;
if (programmingLanguage == null) {
if (other.programmingLanguage != null)
return false;
} else if (!programmingLanguage.equals(other.programmingLanguage))
return false;
if (source == null) {
if (other.source != null)
return false;
} else if (!source.equals(other.source))
return false;
if (structure == null) {
if (other.structure != null)
return false;
} else if (!structure.equals(other.structure))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
if (type != other.type)
return false;
return true;
}
}
package at.ac.uibk.gitsearch.es.model;
import org.junit.jupiter.api.Test;
import at.ac.uibk.gitsearch.testingUtilities.PropertiesTester;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
/**
* just some very simple tests for test coverage :-)
* @author Michael Breu
*
*/
class ExerciseInfoTest {
PropertiesTester propertiesTester = new PropertiesTester();
@Test
void testProperties() {
propertiesTester.testProperties(ExerciseInfo.class);
}
@Test
void testEquals() {
EqualsVerifier.simple().forClass(ExerciseInfo.class).suppress(Warning.NONFINAL_FIELDS).verify();
}
}
......@@ -15,8 +15,8 @@ import { MockActivatedRoute, MockRouter } from './helpers/mock-route.service';
import { MockActiveModal } from './helpers/mock-active-modal.service';
import { MockAlertService } from './helpers/mock-alert.service';
import { MockEventManager } from './helpers/mock-event-manager.service';
import { UserWatchListService } from 'app/entities/user-watch-list/user-watch-list.service';
import { MockUserWatchListService } from './helpers/mock-userWatchList.service';
// import { UserWatchListService } from 'app/entities/user-watch-list/user-watch-list.service';
// import { MockUserWatchListService } from './helpers/mock-userWatchList.service';
import { TranslateService } from '@ngx-translate/core';
@NgModule({
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment