Home > testing > unit_tests > miriamTests.m

miriamTests

PURPOSE ^

run this test case with the command

SYNOPSIS ^

function tests = miriamTests

DESCRIPTION ^

run this test case with the command
results = runtests('miriamTests.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('miriamTests.m')
0003 function tests = miriamTests
0004 tests = functiontests(localfunctions);
0005 end
0006 
0007 function editMiriam_and_extractMiriamTest(testCase)
0008 %This function tests the extractMiriam and editMiriam functions
0009 
0010 %%
0011 %Load the expected (i.e. sorted) model
0012 sourceDir = fileparts(which(mfilename));
0013 load([sourceDir,'/test_data/ecoli_textbook.mat'], 'model');
0014 
0015 %Try out all combinations, keep metMiriams field, compare with output
0016 modelTest=editMiriam(model,'met',1,'bigg.metabolite','test','add');
0017 testOut{1}=modelTest.metMiriams;
0018 modelTest=editMiriam(model,'met',1,'bigg.metabolite','test','replace');
0019 testOut{end+1}=modelTest.metMiriams;
0020 modelTest=editMiriam(model,'met',1,'bigg.metabolite','test','fill');
0021 testOut{end+1}=modelTest.metMiriams;
0022 modelTest=editMiriam(model,'met','all','bigg.metabolite','test','add');
0023 testOut{end+1}=modelTest.metMiriams;
0024 modelTest=editMiriam(model,'met',true(1,numel(model.mets)),'bigg.metabolite','test','add');
0025 testOut{end+1}=modelTest.metMiriams;
0026 modelTest=editMiriam(model,'met','3pg_c','bigg.metabolite','test','add');
0027 testOut{end+1}=modelTest.metMiriams;
0028 modelTest=editMiriam(model,'met','3pg_c','bigg.metabolite','3pg','add');
0029 testOut{end+1}=modelTest.metMiriams;
0030 
0031 %Load the correct results to compare with
0032 load([sourceDir,'/test_data/miriamTestOutput.mat'])
0033 
0034 %Check that the actual model is the same as the expected model
0035 verifyEqual(testCase,testOut,testOutOriginal)
0036 end

Generated by m2html © 2005