Ejemplo n.º 1
0
        public void EditTest()
        {
            var oldTruck = _context.Trucks.Where(x => x.Chassis == "ABC123").OrderByDescending(x => x.Id).FirstOrDefault();

            if (oldTruck == null)
            {
                Assert.Fail();
                return;
            }

            var oldMaximunLoad = oldTruck.MaximumLoad;

            oldTruck.MaximumLoad = oldMaximunLoad + 500;

            _controller.Edit(oldTruck);

            var editedTruck = _context.Trucks.Find(oldTruck.Id);

            if (editedTruck.MaximumLoad != (oldMaximunLoad + 500))
            {
                Assert.Fail();
                return;
            }

            Assert.Pass();
        }