예제 #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);
        }
예제 #2
0
        public void GetFactoryByIdTest()
        {
            Factory    factory = CreateFactory();
            FactoryDAO dao     = new FactoryDAO();
            bool       insert  = dao.InsertFactory(factory);

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

            Assert.IsTrue(factory.FacotryId == factoryPom.FacotryId && factory.BaseId == factoryPom.BaseId);

            dao.RemoveFactoryById(factory.FacotryId);
        }
예제 #3
0
        public void RemoveFactoryByIdTest()
        {
            Factory    factory = CreateFactory();
            FactoryDAO dao     = new FactoryDAO();
            bool       insert  = dao.InsertFactory(factory);

            dao.RemoveFactoryById(factory.FacotryId);

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

            Assert.IsNull(factoryPom);
        }