mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 10:08:02 -06:00
tests: revamp tests, remove more useless tests
This commit is contained in:
@@ -19,7 +19,7 @@ fn mock_animated_texture(id: u32) -> AnimatedTexture {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_partial_directions() {
|
||||
fn test_directional_texture_partial_directions() {
|
||||
let mut textures = HashMap::new();
|
||||
textures.insert(Direction::Up, mock_animated_texture(1));
|
||||
|
||||
@@ -33,18 +33,23 @@ fn test_partial_directions() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_all_directions() {
|
||||
fn test_directional_texture_all_directions() {
|
||||
let mut textures = HashMap::new();
|
||||
textures.insert(Direction::Up, mock_animated_texture(1));
|
||||
textures.insert(Direction::Down, mock_animated_texture(2));
|
||||
textures.insert(Direction::Left, mock_animated_texture(3));
|
||||
textures.insert(Direction::Right, mock_animated_texture(4));
|
||||
let directions = [
|
||||
(Direction::Up, 1),
|
||||
(Direction::Down, 2),
|
||||
(Direction::Left, 3),
|
||||
(Direction::Right, 4),
|
||||
];
|
||||
|
||||
for (direction, id) in directions {
|
||||
textures.insert(direction, mock_animated_texture(id));
|
||||
}
|
||||
|
||||
let texture = DirectionalAnimatedTexture::new(textures, HashMap::new());
|
||||
|
||||
assert_eq!(texture.texture_count(), 4);
|
||||
assert!(texture.has_direction(Direction::Up));
|
||||
assert!(texture.has_direction(Direction::Down));
|
||||
assert!(texture.has_direction(Direction::Left));
|
||||
assert!(texture.has_direction(Direction::Right));
|
||||
for direction in &[Direction::Up, Direction::Down, Direction::Left, Direction::Right] {
|
||||
assert!(texture.has_direction(*direction));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user