Exemplo n.º 1
0
        public void Get_By_Id_Returns_Existing()
        {
            Director d = new Director();

            d.FirstName = "TestReturn";
            d.LastName  = "Test";
            int id = manager.Create(d);

            var actual = manager.GetById(id);

            Assert.IsNotNull(actual);
            Assert.AreEqual("TestReturn", actual.FirstName);
        }
        public ActionResult Edit(int Id)
        {
            Director director;

            using (manager = new DirectorManager())
            {
                director = manager.GetById(Id);
                if (director == null)
                {
                    return(HttpNotFound());
                }
                else
                {
                    return(View(director));
                }
            }
        }