Ejemplo n.º 1
0
        public void DetailsAvecId0ouInexistant_DoitRetournerUn_HttpNotFound()
        {
            int?id = 0;
            var dossierEtuController = new DossierEtudiantController(new TestRepository());

            var result = dossierEtuController.Details(id);

            Assert.AreEqual(typeof(HttpNotFoundResult), result.GetType());
        }
Ejemplo n.º 2
0
        public void DetailsAvecIdNull_DoitRetournerUn_HttpBadRequest()
        {
            var dossierEtuController = new DossierEtudiantController();

            var result = dossierEtuController.Details(null);

            Assert.AreEqual(typeof(HttpStatusCodeResult), result.GetType());
            Assert.AreEqual((int)HttpStatusCode.BadRequest, ((HttpStatusCodeResult)result).StatusCode);
        }