Browse Source

Merge branch 'encounter' of into encounter

remotes/origin/encounter
János 2 years ago
parent
commit
787d3eea93
  1. 1
      src/c/encounter.c
  2. 6
      test/c/test_encounter.c

1
src/c/encounter.c

@ -4,6 +4,7 @@
#include <stdbool.h>
#include "encounter.h"
/*Gegner mit AC, damagedealt = damage-AC, kann nicht kleiner 1 sein
evtl. lair bonus der dem gegner ein wenig mehr/weniger damage erlaubt
gegner erhalten eine zufällige menge Gold, die beim tod an den spieler gegeben werden

6
test/c/test_encounter.c

@ -4,6 +4,7 @@
#include "encounter.h"
void setUp(void){
}
@ -21,7 +22,6 @@ void test_isPlayerAlive_healthGreaterZero(void)
TEST_ASSERT_TRUE(playerAlive(health));
}
void test_isPlayerAlive_healthLowerZero(void)
{
//arrange
@ -127,7 +127,8 @@ void test_PlayerAttacksEnemy_DoesMinDamage(void)
}
//A better way to get the value of a struct, REFACTORING if it works
void test_getterWithParams(void){
void test_getterWithParams(void)
{
int health = 50, armor = 4, damage = 4, attack = 5;
enemy test = {health, damage, armor, attack};
TEST_ASSERT_EQUAL(health, getEnemyInt(&test.health));
@ -135,7 +136,6 @@ void test_getterWithParams(void){
TEST_ASSERT_EQUAL(damage, getEnemyInt(&test.damage));
TEST_ASSERT_EQUAL(attack, getEnemyInt(&test.attack));
}
void test_switchingTurns(void)
{
//arrange

Loading…
Cancel
Save