package com.jasamedika.medifirst2000.dao.test;

/**Agama Class Test
 */

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.jasamedika.medifirst2000.dao.custom.impl.KalkulatorDaoCustomImpl;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
public class KalkulatorDaoTest {

	@Autowired
	private KalkulatorDaoCustomImpl dao;

	@Test
	public void testKalkluator() {
		String operationInput = "14 + 6/3 - 3*5 + 9-8 * (4-2)";
		int result = dao.calculateFromString(operationInput);
		assertEquals(-6, result);
	}
}
