Mercurial > hg > Members > tatsuki > bench > jungle-core
comparison src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/nodeeditor/DeleteChildAtTest.java @ 42:a545fe750a78
added more tests
author | Shoshi TAMAKI |
---|---|
date | Thu, 31 Jan 2013 00:09:51 +0900 |
parents | |
children | 650fe2a0dccc |
comparison
equal
deleted
inserted
replaced
41:ed6737db637a | 42:a545fe750a78 |
---|---|
1 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.nodeeditor; | |
2 | |
3 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNode; | |
4 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.AppendChildAt; | |
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteChildAt; | |
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.ClonableDefaultNode; | |
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; | |
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; | |
9 import junit.framework.Assert; | |
10 import junit.framework.TestCase; | |
11 | |
12 public class DeleteChildAtTest extends TestCase | |
13 { | |
14 public void testEdit() | |
15 { | |
16 ClonableDefaultNode node = new ClonableDefaultNode(new DefaultNode()); | |
17 Either<Error,ClonableDefaultNode> either = node.getChildren().addNewChildAt(0); | |
18 if(either.isA()){ | |
19 Assert.fail(); | |
20 } | |
21 node = either.b(); | |
22 Assert.assertEquals(1,node.getChildren().size()); | |
23 | |
24 DeleteChildAt op = new DeleteChildAt(0); | |
25 either = op.edit(node); | |
26 if(either.isA()){ | |
27 Assert.fail(); | |
28 } | |
29 node = either.b(); | |
30 Assert.assertEquals(0,node.getChildren().size()); | |
31 } | |
32 } |