<commit_before>package de.uka.ipd.sdq.beagle.core.measurement;

import static de.uka.ipd.sdq.beagle.core.testutil.EqualsMatcher.hasDefaultEqualsProperties;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;

import org.junit.Test;

/**
 * Tests {@link ParameterisationDependentMeasurementResult} and contains all test cases
 * needed to check every method.
 * 
 * @author <NAME>
 */
public class ParameterisationDependentMeasurementResultTest {

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#ParameterisationDependentMeasurementResult()}
	 * .
	 */
	@Test
	public void testParameterisationDependentMeasurementResult() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#ParameterisationDependentMeasurementResult(Parameterisation)}
	 * .
	 */
	@Test
	public void testParameterisationDependentMeasurementResultParameterisation() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#getParameterisation()} .
	 */
	@Test
	public void testGetParameterisation() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#equals(java.lang.Object)} and
	 * {@link ParameterisationDependentMeasurementResult#hashCode()}.
	 * 
	 * <p>Asserts that equals has the default properties, a
	 * {@link ParameterisationDependentMeasurementResult} with {@link Parameterisation} is
	 * not equal to one without, and that if the {@link Parameterisation} is (not) equal
	 * to the one of the other {@link ParameterisationDependentMeasurementResult} these
	 * are (not) equal to.
	 * 
	 * <p>Asserts that if the {@link ParameterisationDependentMeasurementResult} are equal
	 * the hashCode is the same.
	 */
	@Test
	public void testEqualsObject() {
		final Parameterisation parameterisation1 = mock(Parameterisation.class);
		final Parameterisation parameterisation2 = mock(Parameterisation.class);
		final Parameterisation parameterisation3 = mock(Parameterisation.class);
		given(parameterisation1.equals(parameterisation2)).willReturn(true);
		given(parameterisation2.equals(parameterisation3)).willReturn(false);
		final ParameterisationDependentMeasurementResult measurementResult =
			new ParameterisationDependentMeasurementResult() {
			};
		final ParameterisationDependentMeasurementResult measurementResultP1 =
			new ParameterisationDependentMeasurementResult(parameterisation1) {
			};<commit_msg>implemented all Test methods in ParamertisationDependentMeasurementResult.<commit_after>package de.uka.ipd.sdq.beagle.core.measurement;

import static de.uka.ipd.sdq.beagle.core.testutil.EqualsMatcher.hasDefaultEqualsProperties;
import static de.uka.ipd.sdq.beagle.core.testutil.ExceptionThrownMatcher.throwsException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;

import de.uka.ipd.sdq.beagle.core.testutil.ThrowingMethod;

import org.junit.Test;

/**
 * Tests {@link ParameterisationDependentMeasurementResult} and contains all test cases
 * needed to check every method.
 * 
 * @author <NAME>
 */
public class ParameterisationDependentMeasurementResultTest {

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#ParameterisationDependentMeasurementResult()}
	 * .
	 */
	@Test
	public void testParameterisationDependentMeasurementResult() {
		new ParameterisationDependentMeasurementResult() {
		};
	}

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#ParameterisationDependentMeasurementResult(Parameterisation)}
	 * .
	 */
	@Test
	public void testParameterisationDependentMeasurementResultParameterisation() {
		final Parameterisation parameterisation = mock(Parameterisation.class);
		new ParameterisationDependentMeasurementResult(parameterisation) {
		};
		final ThrowingMethod method = () -> {
			new ParameterisationDependentMeasurementResult(null) {
			};
		};
		assertThat("Parameterisation must not be null.", method, throwsException(NullPointerException.class));
	}

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#getParameterisation()} .
	 * 
	 * <p>Asserts that correct parameterisation is returned for valid parameterisation and
	 * that {@code null} is returned if no parameterisation is defined.
	 */
	@Test
	public void testGetParameterisation() {
		final Parameterisation parameterisation = mock(Parameterisation.class);
		final ParameterisationDependentMeasurementResult measurementResult =
			new ParameterisationDependentMeasurementResult(parameterisation) {
			};
		assertThat(measurementResult.getParameterisation(), is(parameterisation));
		final ParameterisationDependentMeasurementResult measurementResultWithoutParamerterisation =
			new ParameterisationDependentMeasurementResult() {
			};
		assertThat(measurementResultWithoutParamerterisation.getParameterisation(), is(nullValue()));
	}

	/**
	 * Test method for
	 * {@link ParameterisationDependentMeasurementResult#equals(java.lang.Object)} and
	 * {@link ParameterisationDependentMeasurementResult#hashCode()}.
	 * 
	 * <p>Asserts that equals has the default properties, a
	 * {@link ParameterisationDependentMeasurementResult} with {@link Parameterisation} is
	 * not equal to one without, and that if the {@link Parameterisation} is (not) equal
	 * to the one of the other {@link ParameterisationDependentMeasurementResult} these
	 * are (not) equal to.
	 * 
	 * <p>Asserts that if the {@link ParameterisationDependentMeasurementResult} are equal
	 * the hashCode is the same.
	 */
	@Test
	public void testEqualsObject() {
		final Parameterisation parameterisation1 = mock(Parameterisation.class);
		final Parameterisation parameterisation2 = mock(Parameterisation.class);
		final Parameterisation parameterisation3 = mock(Parameterisation.class);
		given(parameterisation1.equals(parameterisation2)).willReturn(true);
		given(parameterisation2.equals(parameterisation3)).willReturn(false);
		final ParameterisationDependentMeasurementResult measurementResult =
			new ParameterisationDependentMeasurementResult() {
			};
		final ParameterisationDependentMeasurementResult measurementResultP1 =
			new ParameterisationDependentMeasurementResult(parameterisation1) {
			};
{'fraction_non_alphanumeric': 0.08622441573523008, 'fraction_numerical': 0.00261286108288576, 'mean_word_length': 6.177083333333333, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5017996', 'n_tokens_mistral': 1925, 'n_tokens_neox': 1795, 'n_words': 409}