Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
eaa015d3
Commit
eaa015d3
authored
5 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup
parent
4445609a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Klausuren/Sd1/2017winter/Solve/src/test/java/de/hdm_stuttgart/mi/sd1/test/aufgabe2/MaexchenVergleich.java
+0
-143
0 additions, 143 deletions
...hdm_stuttgart/mi/sd1/test/aufgabe2/MaexchenVergleich.java
with
0 additions
and
143 deletions
Klausuren/Sd1/2017winter/Solve/src/test/java/de/hdm_stuttgart/mi/sd1/test/aufgabe2/MaexchenVergleich.java
deleted
100644 → 0
+
0
−
143
View file @
4445609a
package
de.hdm_stuttgart.mi.sd1.test.aufgabe2
;
import
de.hdm_stuttgart.mi.sd1.aufgabe2.MaexleWurf
;
import
org.junit.Assert
;
import
org.junit.FixMethodOrder
;
import
org.junit.Test
;
import
org.junit.runners.MethodSorters
;
import
de.hdm_stuttgart.mi.exam.unitmarking.ExaminationTestDefaults
;
import
de.hdm_stuttgart.mi.exam.unitmarking.Marking
;
/**
* Teste Ordnung von Würfelergebnissen beim »Mäxchen« Spiel.
*
*/
@FixMethodOrder
(
MethodSorters
.
NAME_ASCENDING
)
@SuppressWarnings
({
"UnusedDeclaration"
})
public
class
MaexchenVergleich
extends
ExaminationTestDefaults
{
private
static
final
MaexleWurf
[]
nichtSonderFaelle1
=
new
MaexleWurf
[(
5
*
6
)
/
2
-
1
],
nichtSonderFaelle2
=
new
MaexleWurf
[(
5
*
6
)
/
2
-
1
],
paschFaelle
=
new
MaexleWurf
[
6
],
maexchenFaelle
=
new
MaexleWurf
[
2
];
static
{
int
index
=
0
;
for
(
int
i
=
3
;
i
<=
6
;
i
++)
{
// 5 + 4 + 3 + 2 + 1
for
(
int
j
=
1
;
j
<
i
;
j
++)
{
nichtSonderFaelle1
[
index
]
=
new
MaexleWurf
(
i
,
j
);
nichtSonderFaelle2
[
index
]
=
new
MaexleWurf
(
j
,
i
);
index
++;
}
}
for
(
int
i
=
1
;
i
<=
6
;
i
++)
{
paschFaelle
[
i
-
1
]
=
new
MaexleWurf
(
i
,
i
);
}
maexchenFaelle
[
0
]
=
new
MaexleWurf
(
1
,
2
);
maexchenFaelle
[
1
]
=
new
MaexleWurf
(
2
,
1
);
}
/**
* toString()
*/
@Test
@Marking
(
points
=
2
)
public
void
test_80
()
{
Assert
.
assertEquals
(
"(3|1)"
,
new
MaexleWurf
(
1
,
3
).
toString
());
Assert
.
assertEquals
(
"(3|1)"
,
new
MaexleWurf
(
3
,
1
).
toString
());
}
/**
* Gleichheit nicht-Sonderfälle
*/
@Test
@Marking
(
points
=
4
)
public
void
test_100
()
{
for
(
int
i
=
0
;
i
<
nichtSonderFaelle1
.
length
;
i
++)
{
Assert
.
assertEquals
(
0
,
nichtSonderFaelle1
[
i
].
compareTo
(
nichtSonderFaelle1
[
i
]));
Assert
.
assertEquals
(
0
,
nichtSonderFaelle2
[
i
].
compareTo
(
nichtSonderFaelle2
[
i
]));
Assert
.
assertEquals
(
0
,
nichtSonderFaelle1
[
i
].
compareTo
(
nichtSonderFaelle2
[
i
]));
Assert
.
assertEquals
(
0
,
nichtSonderFaelle2
[
i
].
compareTo
(
nichtSonderFaelle1
[
i
]));
}
}
/**
* Gleichheit Pasch
*/
@Test
@Marking
(
points
=
2
)
public
void
test_120
()
{
for
(
int
i
=
1
;
i
<=
6
;
i
++)
{
Assert
.
assertEquals
(
0
,
paschFaelle
[
i
-
1
].
compareTo
(
new
MaexleWurf
(
i
,
i
)));
}
}
/**
* Gleichheit Mäxchen
*/
@Test
@Marking
(
points
=
2
)
public
void
test_140
()
{
Assert
.
assertEquals
(
0
,
new
MaexleWurf
(
1
,
2
).
compareTo
(
new
MaexleWurf
(
1
,
2
)));
Assert
.
assertEquals
(
0
,
new
MaexleWurf
(
1
,
2
).
compareTo
(
new
MaexleWurf
(
2
,
1
)));
Assert
.
assertEquals
(
0
,
new
MaexleWurf
(
2
,
1
).
compareTo
(
new
MaexleWurf
(
1
,
2
)));
}
/**
* Ungleichheit Normalfälle untereinander
*/
@Test
@Marking
(
points
=
2
)
public
void
test_220
()
{
for
(
int
i
=
0
;
i
<
nichtSonderFaelle1
.
length
;
i
++)
{
for
(
int
j
=
i
+
1
;
j
<
nichtSonderFaelle1
.
length
;
j
++)
{
Assert
.
assertTrue
(
0
<
nichtSonderFaelle1
[
i
].
compareTo
(
nichtSonderFaelle1
[
j
]));
Assert
.
assertTrue
(
0
<
nichtSonderFaelle1
[
i
].
compareTo
(
nichtSonderFaelle2
[
j
]));
Assert
.
assertTrue
(
0
<
nichtSonderFaelle2
[
i
].
compareTo
(
nichtSonderFaelle1
[
j
]));
Assert
.
assertTrue
(
0
<
nichtSonderFaelle2
[
i
].
compareTo
(
nichtSonderFaelle2
[
j
]));
Assert
.
assertTrue
(
nichtSonderFaelle1
[
j
].
compareTo
(
nichtSonderFaelle1
[
i
])
<
0
);
Assert
.
assertTrue
(
nichtSonderFaelle1
[
j
].
compareTo
(
nichtSonderFaelle2
[
i
])
<
0
);
Assert
.
assertTrue
(
nichtSonderFaelle2
[
j
].
compareTo
(
nichtSonderFaelle1
[
i
])
<
0
);
Assert
.
assertTrue
(
nichtSonderFaelle2
[
j
].
compareTo
(
nichtSonderFaelle2
[
i
])
<
0
);
}
}
}
/**
* Ungleichheit Pasch - Normalfall
*/
@Test
@Marking
(
points
=
4
)
public
void
test_240
()
{
for
(
int
i
=
0
;
i
<
nichtSonderFaelle1
.
length
;
i
++)
{
for
(
final
MaexleWurf
p
:
paschFaelle
)
{
Assert
.
assertTrue
(
0
<
nichtSonderFaelle1
[
i
].
compareTo
(
p
));
Assert
.
assertTrue
(
0
<
nichtSonderFaelle2
[
i
].
compareTo
(
p
));
Assert
.
assertTrue
(
p
.
compareTo
(
nichtSonderFaelle1
[
i
])
<
0
);
Assert
.
assertTrue
(
p
.
compareTo
(
nichtSonderFaelle2
[
i
])
<
0
);
}
}
}
/**
* Ungleichheit Mäxchen - Normalfall
*/
@Test
@Marking
(
points
=
2
)
public
void
test_260
()
{
for
(
int
i
=
0
;
i
<
nichtSonderFaelle1
.
length
;
i
++)
{
for
(
final
MaexleWurf
m:
maexchenFaelle
)
{
Assert
.
assertTrue
(
m
.
compareTo
(
nichtSonderFaelle1
[
i
])
<
0
);
Assert
.
assertTrue
(
m
.
compareTo
(
nichtSonderFaelle2
[
i
])
<
0
);
Assert
.
assertTrue
(
0
<
nichtSonderFaelle1
[
i
].
compareTo
(
m
));
Assert
.
assertTrue
(
0
<
nichtSonderFaelle2
[
i
].
compareTo
(
m
));
}
}
}
/**
* Ungleichheit Mäxchen - Pashh
*/
@Test
@Marking
(
points
=
2
)
public
void
test_280
()
{
for
(
final
MaexleWurf
m:
maexchenFaelle
)
{
for
(
final
MaexleWurf
p:
paschFaelle
)
{
Assert
.
assertTrue
(
0
<
p
.
compareTo
(
m
));
Assert
.
assertTrue
(
m
.
compareTo
(
p
)
<
0
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment