Refactored tests into DefaultValues test and, actual set values test

This commit is contained in:
Kristian Flikka
2013-11-08 09:14:57 +01:00
parent e5b921fe1c
commit e02cfe3878

View File

@@ -30,14 +30,24 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
BOOST_AUTO_TEST_CASE(CreateWellCorrentName) {
Opm::TimeMapPtr createXDaysTimeMap(size_t numDays) {
boost::gregorian::date startDate( 2010 , boost::gregorian::Jan , 1);
Opm::TimeMapPtr timeMap(new Opm::TimeMap(startDate));
for (size_t i = 0; i < 10; i++)
for (size_t i = 0; i < numDays; i++)
timeMap->addTStep( boost::posix_time::hours( (i+1) * 24 ));
return timeMap;
}
BOOST_AUTO_TEST_CASE(CreateWell_CorrectNameAndDefaultValues) {
Opm::TimeMapPtr timeMap = createXDaysTimeMap(10);
Opm::Well well("WELL1" , timeMap);
BOOST_CHECK_EQUAL( "WELL1" , well.name() );
BOOST_CHECK_EQUAL(0.0 , well.getOilRate( 5 ));
}
BOOST_AUTO_TEST_CASE(setOilRate_RateSetCorrect) {
Opm::TimeMapPtr timeMap = createXDaysTimeMap(10);
Opm::Well well("WELL1" , timeMap);
BOOST_CHECK_EQUAL(0.0 , well.getOilRate( 5 ));
well.setOilRate( 5 , 99 );
BOOST_CHECK_EQUAL(99 , well.getOilRate( 5 ));