Mercurial > repos > public > sbplib
comparison +multiblock/BoundaryGroupTest.m @ 192:3cedd5a596bb feature/grids
Added tests for boundary group.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 06 Apr 2016 12:54:52 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
191:7c1d3fc33f90 | 192:3cedd5a596bb |
---|---|
1 function tests = BoundaryGroupTest() | |
2 tests = functiontests(localfunctions); | |
3 end | |
4 | |
5 function testCreation(testCase) | |
6 in = {{3,'n'},{2,'hoho'},{1,'s'}}; | |
7 | |
8 blockIDs = [3 2 1]; | |
9 names = {'n', 'hoho', 's'}; | |
10 | |
11 bg = multiblock.BoundaryGroup(in{:}); | |
12 testCase.verifyEqual(bg.blockIDs, blockIDs); | |
13 testCase.verifyEqual(bg.names, names); | |
14 end | |
15 | |
16 function testInputError(testCase) | |
17 in = { | |
18 {'n', 's'}, | |
19 {{3,'n'},{2,2,'hoho'},{1,'s'}}, | |
20 }; | |
21 | |
22 out = { | |
23 'multiblock:BoundaryGroup:BoundaryGroup:InvalidInput', | |
24 'multiblock:BoundaryGroup:BoundaryGroup:InvalidInput', | |
25 }; | |
26 | |
27 for i = 1:length(in) | |
28 testCase.verifyError(@()multiblock.BoundaryGroup(in{i}{:}), out{i}); | |
29 end | |
30 end |