Пример #1
0
        public void UpdateFactoryByIdTest()
        {
            Factory    factory = CreateFactory();
            FactoryDAO dao     = new FactoryDAO();
            bool       insert  = dao.InsertFactory(factory);

            Base basPom = new Base();

            basPom.Planet = "Mars";
            BaseDAO baseDAO = new BaseDAO();

            baseDAO.InsertBase(basPom);
            factory.BaseId     = bas.BaseId;
            factory.CargoCount = 40;
            factory.Type       = "služby";

            dao.UpdateFactoryById(factory);

            Factory factoryPom = dao.GetFactoryById(factory.FacotryId);

            Assert.IsTrue(factoryPom.BaseId == bas.BaseId && factoryPom.CargoCount == 40 && factoryPom.Type == "služby");

            dao.RemoveFactoryById(factory.FacotryId);
            baseDAO.RemoveBaseById(basPom.BaseId);
        }