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); }
public void GetFactoriesByTypeTest() { Factory factory = CreateFactory(); FactoryDAO dao = new FactoryDAO(); bool insert = dao.InsertFactory(factory); int firstId = factory.FacotryId; factory.Type = "služby"; dao.InsertFactory(factory); List <Factory> factoryPom = dao.GetFactoriesByType("zboží"); Assert.IsTrue(factoryPom.Count == 1); dao.RemoveFactoryById(factory.FacotryId); dao.RemoveFactoryById(firstId); }
public void InsertFactoryTest() { Factory factory = CreateFactory(); FactoryDAO dao = new FactoryDAO(); bool insert = dao.InsertFactory(factory); Assert.IsTrue(insert); dao.RemoveFactoryById(factory.FacotryId); }
public void GetFactoriesTest() { Factory factory = CreateFactory(); FactoryDAO dao = new FactoryDAO(); bool insert = dao.InsertFactory(factory); List <Factory> factoryPom = dao.GetFactories(); Assert.IsTrue(factoryPom.Count == 1); }
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); }
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); }
public void GetFactoriesByPlanetTest() { Factory factory = CreateFactory(); FactoryDAO dao = new FactoryDAO(); bool insert = dao.InsertFactory(factory); int firstId = factory.FacotryId; Base basPom = new Base(); basPom.Planet = "Mars"; BaseDAO baseDAO = new BaseDAO(); baseDAO.InsertBase(basPom); factory.BaseId = basPom.BaseId; dao.InsertFactory(factory); List <Factory> factoryPom = dao.GetFactoriesByPlanet("Země"); Assert.IsTrue(factoryPom.Count == 1); dao.RemoveFactoryById(factory.FacotryId); dao.RemoveFactoryById(firstId); baseDAO.RemoveBaseById(basPom.BaseId); }