Gridarta Editor
AbstractMapArchObjectTest.java
Go to the documentation of this file.
1
/*
2
* Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3
* Copyright (C) 2000-2023 The Gridarta Developers.
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License along
16
* with this program; if not, write to the Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
*/
19
20
package
net.sf.gridarta.model.maparchobject;
21
22
import
java.io.File;
23
import
net
.
sf
.
gridarta
.
model
.
direction
.
Direction
;
24
import
net
.
sf
.
gridarta
.
model
.
mapmodel
.
MapFile
;
25
import
net
.
sf
.
gridarta
.
model
.
mapmodel
.
MapPathUtils
;
26
import
org.junit.Assert;
27
import
org.junit.Test;
28
32
@SuppressWarnings(
"JavaDoc"
)
33
public class
AbstractMapArchObjectTest
{
34
35
@Test
36
public
void
calculateTilePath_noCurrentPath_returnsEmptyPath
() {
37
Assert.assertEquals(
""
,
new
TestMapArchObject
().calculateTilePath(
Direction
.
EAST
,
null
));
38
}
39
40
@Test
41
public
void
calculateTilePath_noCoordinates1_returnsEmptyPath
() {
42
Assert.assertEquals(
""
,
new
TestMapArchObject
().calculateTilePath(
Direction
.
EAST
,
new
MapFile
(
new
File(
"/abc"
))));
43
}
44
45
@Test
46
public
void
calculateTilePath_noCoordinates2_returnsEmptyPath
() {
47
Assert.assertEquals(
""
,
new
TestMapArchObject
().calculateTilePath(
Direction
.
EAST
,
new
MapFile
(
new
MapFile
(
new
File(
"/abc"
)),
MapPathUtils
.
newMapPath
(
"world/world"
))));
48
}
49
50
@Test
51
public
void
calculateTilePath_withCoordinates_returnsPath
() {
52
Assert.assertEquals(
"world_124_456"
,
new
TestMapArchObject
().calculateTilePath(
Direction
.
EAST
,
new
MapFile
(
new
MapFile
(
new
File(
"/abc"
)),
MapPathUtils
.
newMapPath
(
"world/world_123_456"
))));
53
}
54
55
}
net.sf.gridarta.model.direction.Direction
A direction.
Definition:
Direction.java:28
net.sf.gridarta
Base package of all Gridarta classes.
net.sf.gridarta.model.maparchobject.AbstractMapArchObjectTest.calculateTilePath_noCurrentPath_returnsEmptyPath
void calculateTilePath_noCurrentPath_returnsEmptyPath()
Definition:
AbstractMapArchObjectTest.java:36
net.sf.gridarta.model.maparchobject.AbstractMapArchObjectTest.calculateTilePath_withCoordinates_returnsPath
void calculateTilePath_withCoordinates_returnsPath()
Definition:
AbstractMapArchObjectTest.java:51
net.sf
net.sf.gridarta.model.mapmodel
Definition:
AboveFloorInsertionMode.java:20
net.sf.gridarta.model.mapmodel.MapPathUtils.newMapPath
static MapPath newMapPath(@NotNull final String string)
Creates a MapPath instance from string representation.
Definition:
MapPathUtils.java:43
net.sf.gridarta.model.mapmodel.MapPathUtils
Utility class for MapPath related functions.
Definition:
MapPathUtils.java:28
net
net.sf.gridarta.model.maparchobject.AbstractMapArchObjectTest.calculateTilePath_noCoordinates1_returnsEmptyPath
void calculateTilePath_noCoordinates1_returnsEmptyPath()
Definition:
AbstractMapArchObjectTest.java:41
net.sf.gridarta.model.mapmodel.MapFile
The location of a map file with a map directory.
Definition:
MapFile.java:31
net.sf.gridarta.model
net.sf.gridarta.model.direction.Direction.EAST
EAST
East.
Definition:
Direction.java:38
net.sf.gridarta.model.maparchobject.TestMapArchObject
A MapArchObject implementation for testing purposes.
Definition:
TestMapArchObject.java:28
net.sf.gridarta.model.direction
Definition:
Direction.java:20
net.sf.gridarta.model.maparchobject.AbstractMapArchObjectTest
Regression tests for AbstractMapArchObject.
Definition:
AbstractMapArchObjectTest.java:33
net.sf.gridarta.model.maparchobject.AbstractMapArchObjectTest.calculateTilePath_noCoordinates2_returnsEmptyPath
void calculateTilePath_noCoordinates2_returnsEmptyPath()
Definition:
AbstractMapArchObjectTest.java:46
src
model
src
test
java
net
sf
gridarta
model
maparchobject
AbstractMapArchObjectTest.java
Generated on Mon Sep 1 2025 00:35:58 for Gridarta Editor by
1.8.17