Commit 59f78887 authored by Dóra Kocsis's avatar Dóra Kocsis

Add tests to mdbnomics2dseries.m

parent 198023a2
Pipeline #3783 failed with stage
in 1 minute and 7 seconds
......@@ -52,3 +52,81 @@ switch nargin
error('mdbnomics2dseries:WrongInputArguments', 'Too many input arguments! Please check the manual.')
end
end
%@test:1
%$ try
%$ dseries_src_root = strrep(which('initialize_dseries_class'),'initialize_dseries_class.m','');
%$ df_id = load([ dseries_src_root '../tests/data/mdbnomics/df_id.mat']);
%$ df = df_id.df;
%$ ds = mdbnomics2dseries(df);
%$ t(1) = true;
%$ catch
%$ t(1) = false;
%$ end
%$
%$ if t(1)
%$ t(2) = dassert(ds.name, {'EA19_1_0_0_0_ZUTN'});
%$ t(3) = dassert(ds.vobs, 1);
%$ t(4) = dassert(ds.tags.provider_code, {'AMECO'});
%$ t(5:10) = isfield(ds.tags, {'freq', 'unit', 'geo', 'Frequency', 'Unit', 'Country'});
%$ end
%$
%$ T = all(t);
%@eof:1
%@test:2
%$ try
%$ dseries_src_root = strrep(which('initialize_dseries_class'),'initialize_dseries_class.m','');
%$ df_bi = load([dseries_src_root '../tests/data/mdbnomics/df_bi-annual.mat']);
%$ df = df_bi.df;
%$ ds = mdbnomics2dseries(df);
%$ t(1) = true;
%$ catch
%$ t(1) = false;
%$ end
%$
%$ if t(1)
%$ t(2) = dassert(ds.name, {'S_EUR_AL'});
%$ t(3) = dassert(ds.vobs, 1);
%$ t(4) = dassert(ds.dates.freq, 2);
%$ t(4) = dassert(ds.tags.provider_code, {'Eurostat'});
%$ t(5:10) = isfield(ds.tags, {'FREQ', 'currency', 'geo', 'Frequency', 'Currency', 'Geopolitical_entity__reporting_'});
%$ end
%$
%$ T = all(t);
%@eof:2
%@test:3
%$ try
%$ dseries_src_root = strrep(which('initialize_dseries_class'),'initialize_dseries_class.m','');
%$ df_dataset = load([ dseries_src_root '../tests/data/mdbnomics/df_dataset.mat']);
%$ df = df_dataset.df;
%$ ds = mdbnomics2dseries(df);
%$ t(1) = true;
%$ catch
%$ t(1) = false;
%$ end
%$
%$ if t(1)
%$ t(2) = dassert(ds.vobs, 49);
%$ t(3) = dassert(ds.dates.freq, 1);
%$ t(4) = dassert(length(unique(ds.tags.provider_code)), 1);
%$ t(5) = dassert(size(ds.tags.provider_code,1), 49);
%$ end
%$
%$ T = all(t);
%@eof:3
%@test:4
%$ try
%$ dseries_src_root = strrep(which('initialize_dseries_class'),'initialize_dseries_class.m','');
%$ df_multi = load([ dseries_src_root '../tests/data/mdbnomics/df_multi-freq.mat']);
%$ df = df_multi.df;
%$ ds = mdbnomics2dseries(df);
%$ t(1) = false;
%$ catch
%$ t(1) = true;
%$ end
%$
%$ T = all(t);
%@eof:4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment