Home > testing > unit_tests > modelConversionTests.m

modelConversionTests

PURPOSE ^

run this test case with the command

SYNOPSIS ^

function tests = modelConversionTests

DESCRIPTION ^

run this test case with the command
results = runtests('modelConversionTests.m')

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 %run this test case with the command
0002 %results = runtests('modelConversionTests.m')
0003 function tests = modelConversionTests
0004 tests = functiontests(localfunctions);
0005 end
0006 
0007 function ravenCobraWrapperTest(testCase)
0008 %This function tests the ravenCobraWrapper function by going through a full
0009 %cycle RAVEN -> COBRA -> RAVEN, and the model should be (near) identical
0010 %(only annotation field should be lost).
0011 
0012 %Load the model in RAVEN format
0013 sourceDir=fileparts(fileparts(fileparts(which(mfilename))));
0014 load(fullfile(sourceDir,'testing','unit_tests','test_data','ecoli_textbook.mat'), 'model');
0015 
0016 %Prevent writing of messages to command window
0017 evalc('modelCobra=ravenCobraWrapper(model);');
0018 evalc('modelRaven=ravenCobraWrapper(modelCobra);');
0019 
0020 %We know that the annotation field is lost
0021 modelNoAnnot=rmfield(model,'annotation');
0022 
0023 %Check that the actual model is the same as the expected model
0024 verifyEqual(testCase,modelRaven,modelNoAnnot)
0025 end

Generated by m2html © 2005