Commit b5e32ce7 authored by Benjamin BRETECHE's avatar Benjamin BRETECHE

ajout 5 test fonction rent()

parent 88a151f6
......@@ -8,26 +8,41 @@ export class TestSquare {
testRentWithNoBuilding() {
let rueDeLaPaix : Square = createSquare("Rue de la paix", 4, 20, 450);
Expect(rent(rueDeLaPaix)).toBe(4)
Expect(rent(rueDeLaPaix)).toBe(4);
}
@Test("Rent with one house")
testRentWithOneHouse() {
let rueDeLaPaix : Square = createSquare("Rue de la paix", 4, 20, 450);
rueDeLaPaix.houses = 1;
Expect(rent(rueDeLaPaix)).toBe(20);
}
@Test("Rent with two houses")
testRentWithTwoHouses() {
let rueDeLaPaix : Square = createSquare("Rue de la paix", 4, 20, 450);
rueDeLaPaix.houses = 2;
Expect(rent(rueDeLaPaix)).toBe(40);
}
@Test("Rent with three houses")
testRentWithThreeHouses() {
let rueDeLaPaix : Square = createSquare("Rue de la paix", 4, 20, 450);
rueDeLaPaix.houses = 3;
Expect(rent(rueDeLaPaix)).toBe(60);
}
@Test("Rent with four houses")
testRentWithFourHouses() {
let rueDeLaPaix : Square = createSquare("Rue de la paix", 4, 20, 450);
rueDeLaPaix.houses = 4;
Expect(rent(rueDeLaPaix)).toBe(80);
}
@Test("Rent with one hotel")
testRentWithOneHotel() {
let rueDeLaPaix : Square = createSquare("Rue de la paix", 4, 20, 450);
rueDeLaPaix.hotels = 1;
Expect(rent(rueDeLaPaix)).toBe(450);
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment