private Habitat InsertTestHabitat(SQLiteConnection conn, Provider p, int i) { HabitatDAO habitatDAO = new HabitatDAO(); string name = habitatName1[rand.Next(0, habitatName1.Length)] + " " + habitatName2[rand.Next(0, habitatName2.Length)] + i; Habitat h = new Habitat() { HabitatName = name, ProviderId = p.ProviderId }; habitatDAO.Create(h, conn); h.HabitatId = habitatDAO.Read("SELECT * FROM habitats WHERE habitat_id = (SELECT max(habitat_id) FROM habitats)", conn)[0].HabitatId; return h; }
private Habitat InsertTestHabitat(SQLiteConnection conn, Provider p) { HabitatDAO habitatDAO = new HabitatDAO(); Habitat h = new Habitat() { HabitatName = "HuntTestHabitat", ProviderId = p.ProviderId }; habitatDAO.Create(h, conn); h.HabitatId = habitatDAO.Read("SELECT * FROM habitats WHERE habitat_name = 'HuntTestHabitat'", conn)[0].HabitatId; return h; }