Beispiel #1
0
        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);
        }