// GET: Dogs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Dog dog = db.FindById(Convert.ToInt32(id));

            if (dog == null)
            {
                return(HttpNotFound());
            }
            return(View(dog));
        }
示例#2
0
        public void FindById_Returns_Correct_Dog()
        {
            var underTest = new DogRepository();
            var result    = underTest.FindById(1);

            Assert.Equal(1, result.Id);
            Assert.Equal("Neko", result.Name);
        }