forked from WEC-Sim/WEC-Sim_Applications
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestLoadMitigatingControls.m
More file actions
76 lines (69 loc) · 2.23 KB
/
Copy pathTestLoadMitigatingControls.m
File metadata and controls
76 lines (69 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
classdef TestLoadMitigatingControls < matlab.unittest.TestCase
properties
OriginalDefault
testDir
h5Dir = 'hydroData'
h5Name = 'waveBotBuoy.h5'
end
methods (Access = 'public')
function obj = TestLoadMitigatingControls
obj.testDir = fileparts(mfilename('fullpath'));
end
end
methods (TestMethodSetup)
function killPlots (~)
set(0,'DefaultFigureVisible','off');
end
end
methods(TestClassSetup)
function captureVisibility(testCase)
testCase.OriginalDefault = get(0,'DefaultFigureVisible');
end
function removeProjectFolder(~)
d = dir('**');
d = d([d.isdir]);
d = d(string({d.name})=="slprj");
for i = 1:length(d)
rmdir(fullfile(d(i).folder, d(i).name), 's')
end
end
function runBemio(testCase)
cd(testCase.h5Dir);
if isfile(testCase.h5Name)
fprintf('runBemio skipped, *.h5 already exists\n')
else
bemio
end
cd(testCase.testDir)
end
end
methods(TestMethodTeardown)
function returnHome(testCase)
cd(testCase.testDir)
end
end
methods(TestClassTeardown)
function checkVisibilityRestored(testCase)
set(0,'DefaultFigureVisible',testCase.OriginalDefault);
testCase.assertEqual(get(0,'DefaultFigureVisible'), ...
testCase.OriginalDefault);
end
end
methods(Test)
function testLoad_Mitigating_Control_ControlTests(testCase)
cd('ControlTests')
wecSim
close_system('WaveBot3Dof_Control',0)
end
function testLoad_Mitigating_Control_CalcImpedance(testCase)
cd('CalcImpedance')
wecSim
close_system('WaveBot3Dof_ID',0)
end
function testLoad_Mitigating_Control_CalcImpedance_MCR(testCase)
cd('CalcImpedance')
wecSimMCR
close_system('WaveBot3Dof_ID',0)
end
end
end