<commit_before>package org.openhab.binding.em.internal;

import junit.framework.Assert;

import org.junit.Test;
import org.openhab.binding.em.internal.EMBindingConfig.EMType;

/**
 * Class to test the parsing of the received binary messages
 * 
 * @author <NAME>
 * @since 1.4.0
 * 
 */
public class ParsingUtilsTest {

	private static String[] EM_DATA = { "E0205BFCB0402000300F7", "E0205C0CD0402000300FA", "E0205C4D5040200030004" };

	@Test
	public void testParsingEMData() throws Exception {

		String address = ParsingUtils.parseAddress(EM_DATA[0]);
		Assert.assertEquals("05", address);

		EMType type = ParsingUtils.parseType(EM_DATA[0]);
		Assert.assertEquals(EMType.EM100EM, type);

		int cumulatedValue = ParsingUtils.parseCumulatedValue(EM_DATA[0]);
		Assert.assertEquals(1227, cumulatedValue);

		int oldCumulatedValue = 0;
		for (String data : EM_DATA) {
			int cumValue = ParsingUtils.parseCumulatedValue(data);
			Assert.assertTrue(cumValue > oldCumulatedValue);
			oldCumulatedValue = cumValue;
		}
	}

}<commit_msg>Extendes ParsingUtilsTest to cover parsing of all EM types<commit_after>package org.openhab.binding.em.internal;

import junit.framework.Assert;

import org.junit.Test;
import org.openhab.binding.em.internal.EMBindingConfig.EMType;

/**
 * Class to test the parsing of the received binary messages
 * 
 * @author <NAME>
 * @since 1.4.0
 * 
 */
public class ParsingUtilsTest {

	private static String[] EM_DATA = { "E0205BFCB0402000300F7", "E0105C0CD0402000300FA", "E0305C4D5040200030004" };

	@Test
	public void testParsingEMData() throws Exception {

		String address = ParsingUtils.parseAddress(EM_DATA[0]);
		Assert.assertEquals("05", address);

		EMType type = ParsingUtils.parseType(EM_DATA[0]);
		Assert.assertEquals(EMType.EM100EM, type);
		
		type = ParsingUtils.parseType(EM_DATA[1]);
		Assert.assertEquals(EMType.EM1000S, type);
		
		type = ParsingUtils.parseType(EM_DATA[2]);
		Assert.assertEquals(EMType.EM1000GZ, type);

		int cumulatedValue = ParsingUtils.parseCumulatedValue(EM_DATA[0]);
		Assert.assertEquals(1227, cumulatedValue);

		int oldCumulatedValue = 0;
		for (String data : EM_DATA) {
			int cumValue = ParsingUtils.parseCumulatedValue(data);
			Assert.assertTrue(cumValue > oldCumulatedValue);
			oldCumulatedValue = cumValue;
		}
	}

}
{'fraction_non_alphanumeric': 0.112565445026178, 'fraction_numerical': 0.060209424083769635, 'mean_word_length': 5.180592991913747, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '382730', 'n_tokens_mistral': 908, 'n_tokens_neox': 769, 'n_words': 150}