Пример #1
0
        public void SetUp()
        {
            transaction = new TransactionScope();

            DALFactory factory = DALFactory.GetInstance();
            db = factory.CreateDatabase();
            dao = factory.CreateArtistDAO(db);

            artist1 = new Artist {
                Id = 1,
                Name = "Christoph The Wurst",
                Image = "some-image",
                Video = "some-video",
                CategoryId = 3,
                CountryId = 15,
                Email = "*****@*****.**",
            };
            artist2 = new Artist {
                Id = 2,
                Name = "Stefan The Rösch",
                Image = "some-image",
                Video = "some-video",
                CategoryId = 4,
                CountryId = 7,
                Email = "*****@*****.**",
            };

            var sqls = new List<string> {
                "SET FOREIGN_KEY_CHECKS=0",
                "DELETE FROM `artist`",
                "INSERT INTO `artist` VALUES (1, 'Christoph The Wurst', 'some-image', 'some-video', 3, 15, '*****@*****.**', 0)",
                "INSERT INTO `artist` VALUES (2, 'Stefan The Rösch', 'some-image', 'some-video', 4, 7, '*****@*****.**', 0)"
            };
            runDbCommands(db, sqls);
        }
 public DAOFactoryDb4oimpl()
 {
     AlbumDAO = new AlbumDAOdb4o();
     ArtistDAO = new ArtistDAOdb4o();
 }
 public DAOFactoryDb4oimpl()
 {
     AlbumDAO  = new AlbumDAOdb4o();
     ArtistDAO = new ArtistDAOdb4o();
 }