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

import static org.junit.Assert.fail;

import org.junit.Test;

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

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

	/**
	 * Test method for
	 * {@link LoopRepetitionCountMeasurementResult#LoopRepetitionCountMeasurementResult(Parameterisation, int)}
	 * .
	 */
	@Test
	public void testLoopRepetitionCountMeasurementResultParameterisationInt() {
		fail("Not yet implemented");
	}

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

}<commit_msg>implemented Test methods of loopRepetitionCountMeasuremntResult<commit_after>package de.uka.ipd.sdq.beagle.core.measurement;

import static de.uka.ipd.sdq.beagle.core.testutil.ExceptionThrownMatcher.throwsException;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.mock;

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

import org.junit.Test;

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

	/**
	 * Test method for
	 * {@link LoopRepetitionCountMeasurementResult#LoopRepetitionCountMeasurementResult(int)}
	 * .
	 */
	@Test
	public void testLoopRepetitionCountMeasurementResultInt() {
		final int count = 0;
		new LoopRepetitionCountMeasurementResult(count);
		final int count1 = 3;
		new LoopRepetitionCountMeasurementResult(count1);
		final int negativeValue = -2;
		final ThrowingMethod method = () -> {
			new ResourceDemandMeasurementResult(negativeValue);
		};
		assertThat("Count must be non-negative.", method, throwsException(IllegalArgumentException.class));
	}

	/**
	 * Test method for
	 * {@link LoopRepetitionCountMeasurementResult#LoopRepetitionCountMeasurementResult(Parameterisation, int)}
	 * .
	 */
	@Test
	public void testLoopRepetitionCountMeasurementResultParameterisationInt() {
		final Parameterisation parameterisation = mock(Parameterisation.class);
		final int count = 0;
		new LoopRepetitionCountMeasurementResult(count);
		final int count1 = 3;
		new LoopRepetitionCountMeasurementResult(count1);
		final int negativeValue = -2;
		ThrowingMethod method = () -> {
			new ResourceDemandMeasurementResult(parameterisation, negativeValue);
		};
		assertThat("Count must be non-negative.", method, throwsException(IllegalArgumentException.class));
		method = () -> {
			new ResourceDemandMeasurementResult(null, count);
		};
		assertThat("Parameterisation must not be null.", method, throwsException(NullPointerException.class));
	}

	/**
	 * Test method for {@link LoopRepetitionCountMeasurementResult#getCount()} .
	 */
	@Test
	public void testGetCount() {
		final Parameterisation parameterisation = mock(Parameterisation.class);
		int count = 0;
		final LoopRepetitionCountMeasurementResult result = new LoopRepetitionCountMeasurementResult(count);
		final int count1 = 3;
		final LoopRepetitionCountMeasurementResult result1 = new LoopRepetitionCountMeasurementResult(count1);
		final LoopRepetitionCountMeasurementResult resultWithP =
			new LoopRepetitionCountMeasurementResult(parameterisation, count);

		assertThat(result.getCount(), is(equalTo(count)));
		assertThat(result1.getCount(), is(equalTo(count1)));
		assertThat(resultWithP, is(equalTo(count)));
		count = 4;
		assertThat("The returned value must not be influenced by a later change.", result.getCount(),
			is(not(equalTo(count))));
		assertThat("The returned value must not be influenced by a later change.", result1.getCount(),
			is(not(equalTo(count))));
	}

}
{'fraction_non_alphanumeric': 0.10149750415973377, 'fraction_numerical': 0.004516282386498692, 'mean_word_length': 5.6372239747634065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '4050310', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1190, 'n_words': 266}