forked from miho/JCSG
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unit test to ensure grouping doesnt break
- Loading branch information
1 parent
e8bc0bd
commit 92f2826
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package eu.mihosoft.vrl.v3d; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupingTest { | ||
|
||
@Test | ||
public void test() { | ||
CSG c = new Cube(100).toCSG(); | ||
String groupID = "testing"; | ||
c.addGroupMembership(groupID); | ||
c.setName("MyName"); | ||
c.addIsGroupResult(groupID); | ||
CSG copy = c.clone().syncProperties(c).setName(c.getName()); | ||
copy.removeGroupMembership(groupID); | ||
copy.removeIsGroupResult(groupID); | ||
|
||
if(copy.isInGroup()) | ||
fail("Copy should not be in a group"); | ||
if(!c.isInGroup()) | ||
fail("Original should be in a group"); | ||
|
||
if(copy.isGroupResult()) | ||
fail("Copy should not be in a group"); | ||
if(!c.isGroupResult()) | ||
fail("Original should be in a group"); | ||
|
||
} | ||
|
||
} |