public void GetFight_ShouldNotFindFight() { /* Récupération via API */ var fightController = new FightsController(); var dtoFight = fightController.Get(999); Assert.IsInstanceOfType(dtoFight, typeof(NotFoundResult)); }
public void GetFight_ShouldReturnCorrectFight() { ThronesTournamentManager manager = new ThronesTournamentManager(); /* Récupération depuis la couche Business */ var testFight = manager.GetFight(1); /* Récupération via API */ var fightController = new FightsController(); var dtoFight = fightController.Get(1) as OkNegotiatedContentResult <FightDTO>; Assert.IsNotNull(dtoFight); Assert.AreEqual(dtoFight.Content.ID_Territory, testFight.ID_Territory); Assert.AreEqual(dtoFight.Content.ID_War, testFight.ID_War); Assert.AreEqual(dtoFight.Content.FirstCharacter.FirstName, testFight.FirstCharacter.FirstName); }