Mercurial > repos > public > sbplib
diff +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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+multiblock/BoundaryGroupTest.m Wed Apr 06 12:54:52 2016 +0200 @@ -0,0 +1,30 @@ +function tests = BoundaryGroupTest() + tests = functiontests(localfunctions); +end + +function testCreation(testCase) + in = {{3,'n'},{2,'hoho'},{1,'s'}}; + + blockIDs = [3 2 1]; + names = {'n', 'hoho', 's'}; + + bg = multiblock.BoundaryGroup(in{:}); + testCase.verifyEqual(bg.blockIDs, blockIDs); + testCase.verifyEqual(bg.names, names); +end + +function testInputError(testCase) + in = { + {'n', 's'}, + {{3,'n'},{2,2,'hoho'},{1,'s'}}, + }; + + out = { + 'multiblock:BoundaryGroup:BoundaryGroup:InvalidInput', + 'multiblock:BoundaryGroup:BoundaryGroup:InvalidInput', + }; + + for i = 1:length(in) + testCase.verifyError(@()multiblock.BoundaryGroup(in{i}{:}), out{i}); + end +end \ No newline at end of file