Exemple #1
0
        //删除企业信息
        public int deleteCpById(string id)
        {
            int cid    = int.Parse(id);
            int result = QueryDB.Context().Delete(Config.pretable + "search").Where("id", cid).Execute();

            return(result);
        }
        public void TestErrorSavePoints()
        {
            QueryDB queryDB   = new QueryDB();
            bool    saveError = queryDB.SavePoints("MiroStarts", 1000);

            Assert.IsFalse(saveError);
        }
        public void TestSearchBestScorePlayers()
        {
            QueryDB       queryDB          = new QueryDB();
            List <Player> bestScorePlayers = queryDB.SearchBestScoresPlayer();

            Assert.IsNotNull(bestScorePlayers);
        }
        public static void ClassInitializeReport(TestContext testContext)
        {
            Account accountOne = new Account();

            accountOne.passwordAccount  = Encrypt("Mmol180515#");
            accountOne.email            = "*****@*****.**";
            accountOne.confirmationCode = 154863;
            accountOne.nickName         = "MariaFer13";

            Player playerOne = new Player();

            playerOne.lastName     = "Gomez";
            playerOne.nickName     = "MariaFer13";
            playerOne.namePlayer   = "Maria Fernanda";
            playerOne.statusPlayer = "Active";

            Account accountTwo = new Account();

            accountTwo.passwordAccount  = Encrypt("Mmol180515#");
            accountTwo.email            = "*****@*****.**";
            accountTwo.confirmationCode = 154863;
            accountTwo.nickName         = "MiroStart";

            Player playerTwo = new Player();

            playerTwo.lastName     = "Ortiz";
            playerTwo.nickName     = "MiroStart";
            playerTwo.namePlayer   = "Martha";
            playerTwo.statusPlayer = "Active";

            QueryDB queryDB = new QueryDB();

            queryDB.RegisterPlayer(accountOne, playerOne);
            queryDB.RegisterPlayer(accountTwo, playerTwo);
        }
        public void TestErrorIsLog()
        {
            QueryDB queryDB = new QueryDB();
            bool    isLog   = queryDB.IsLog("*****@*****.**", "VwBpAGcAZQB0AHQAYQBfADQA");

            Assert.IsTrue(isLog);
        }
        public void TestSearchSentence()
        {
            QueryDB  queryDB  = new QueryDB();
            Sentence sentence = queryDB.SearchSentence();

            Assert.IsNotNull(sentence.hintSpanish);
        }
        public void TestSavePoints()
        {
            QueryDB queryDB = new QueryDB();
            bool    saveOk  = queryDB.SavePoints("MiroStart", 1000);

            Assert.IsTrue(saveOk);
        }
        public void TestSearchInformationPlayer()
        {
            QueryDB queryDB = new QueryDB();
            Player  player  = queryDB.SearchInformationPlayer("*****@*****.**");

            Assert.IsNotNull(player.nickName);
        }
        public override bool Delete(long key)
        {
            QueryDB query = new QueryDB("DELETE FROM Rating WHERE Id_Rating = @Id");

            query.AddParametre("@Id", key);

            return(Connector.ExecuteNonQuery(query) == 1);
        }
        public override ProductionCompany Get(long key)
        {
            QueryDB query = new QueryDB("SELECT * FROM ProductionCompany WHERE Id_ProductionCompany = @Id");

            query.AddParametre("@Id", key);

            return(Connector.ExecuteReader(query, ConvertReaderToEntity).SingleOrDefault());
        }
        public override ProductionCompany Insert(ProductionCompany entity)
        {
            QueryDB query = new QueryDB("INSERT INTO ProductionCompany (Name) OUTPUT inserted.* VALUES (@name)");

            query.AddParametre("@name", entity.Name);

            return(Connector.ExecuteReader(query, ConvertReaderToEntity).SingleOrDefault());
        }
        public bool Delete(Guid id)
        {
            QueryDB query = new QueryDB("DELETE FROM [ImageData] WHERE [Id] = @Id");

            query.AddParametre("Id", id);

            return(DB.ExecuteNonQuery(query) == 1);
        }
        public override bool Delete(long key)
        {
            QueryDB query = new QueryDB("DELETE FROM ProductionCompany WHERE Id_ProductionCompany = @Id");

            query.AddParametre("@Id", key);

            return(Connector.ExecuteNonQuery(query) == 1);
        }
        public void TestErrorSearchAccount()
        {
            QueryDB queryDB = new QueryDB();
            Account account = new Account();

            account = queryDB.SearchAccount("*****@*****.**");
            Assert.AreEqual("*****@*****.**", account.email);
        }
        public ImageData Get(Guid id)
        {
            QueryDB query = new QueryDB("SELECT * FROM [ImageData] WHERE [Id] = @id");

            query.AddParametre("id", id);

            return(DB.ExecuteReader(query, ConvertReaderToEntity).SingleOrDefault());
        }
        public override Rating Get(long key)
        {
            QueryDB query = new QueryDB("SELECT * FROM Rating WHERE Id_Rating = @Id");

            query.AddParametre("@Id", key);

            return(Connector.ExecuteReader(query, ConvertReaderToEntity).SingleOrDefault());
        }
        public void TestReportAccountPlayer()
        {
            QueryDB queryDB = new QueryDB();
            bool    isReportAccountPlayer;

            isReportAccountPlayer = queryDB.ReportAccountPlayer("MariaFer13");
            Assert.IsTrue(isReportAccountPlayer);
        }
        public void TestDeleteAccountPlayer()
        {
            QueryDB queryDB = new QueryDB();
            bool    isDeleteAccountPlayer;

            isDeleteAccountPlayer = queryDB.DeleteAccountPlayer("MiroStart");
            Assert.IsTrue(isDeleteAccountPlayer);
        }
        public void TestSearchReport()
        {
            List <ReportMisConduct> reportMisConducts = new List <ReportMisConduct>();
            QueryDB queryDB = new QueryDB();

            reportMisConducts = queryDB.SearchReport("MariaFer13");
            Assert.AreEqual(1, reportMisConducts.Count);
        }
        public void TestErrorSearchRepeatNicknamePlayer()
        {
            QueryDB queryDB = new QueryDB();
            bool    isRepeatNicknamePlayer;

            isRepeatNicknamePlayer = queryDB.SearchRepeatNicknamePlayer(null, "MiroStart");
            Assert.IsTrue(isRepeatNicknamePlayer);
        }
        public void TestSearchRepeatNicknamePlayer()
        {
            QueryDB queryDB = new QueryDB();
            bool    isRepeatNicknamePlayer;

            isRepeatNicknamePlayer = queryDB.SearchRepeatNicknamePlayer("Maria123", "MiroStart");
            Assert.IsTrue(isRepeatNicknamePlayer);
        }
        public void TestErrorSearchRepeatEmailAccount()
        {
            QueryDB queryDB = new QueryDB();
            bool    isRepeatEmailAccount;

            isRepeatEmailAccount = queryDB.SearchRepeatEmailAccount("*****@*****.**", 0);
            Assert.IsTrue(isRepeatEmailAccount);
        }
        public void TestErrorSearchPlayer()
        {
            QueryDB queryDB = new QueryDB();
            Player  player  = new Player();

            player = queryDB.SearchPlayer("MarthaStart2563");
            Assert.AreEqual("MarthaStart2563", player.nickName);
        }
        public void TestSearchPlayer()
        {
            QueryDB queryDB = new QueryDB();
            Player  player  = new Player();

            player = queryDB.SearchPlayer("MariaFer13");
            Assert.AreEqual("MariaFer13", player.nickName);
        }
        public IEnumerable <Rating> GetByMovie(long idMovie)
        {
            QueryDB query = new QueryDB("SELECT * FROM Rating WHERE Id_Movie = @IdMovie");

            query.AddParametre("@IdMovie", idMovie);

            return(Connector.ExecuteReader(query, ConvertReaderToEntity));
        }
        public void TestSearchEmailPlayer()
        {
            QueryDB queryDB = new QueryDB();
            bool    isEmailPlayer;

            isEmailPlayer = queryDB.SearchEmailPlayer("*****@*****.**");
            Assert.IsTrue(isEmailPlayer);
        }
        public void TestSearchNicknamePlayer()
        {
            QueryDB queryDB = new QueryDB();
            bool    isNicknamePlayer;

            isNicknamePlayer = queryDB.SearchNicknamePlayer("MiroStart");
            Assert.IsTrue(isNicknamePlayer);
        }
        public void TestErrorSearchEmailPlayer()
        {
            QueryDB queryDB = new QueryDB();
            bool    isEmailPlayer;

            isEmailPlayer = queryDB.SearchEmailPlayer(null);
            Assert.IsTrue(isEmailPlayer);
        }
        public override int Insert(CategoryEntity entity)
        {
            QueryDB query = new QueryDB("InsertCategory", true);

            query.AddParametre("@Name", entity.Name);

            return((int)ConnectDB.ExecuteScalar(query));
        }
        public void TestIsLog()
        {
            QueryDB queryDB         = new QueryDB();
            string  passwordAccount = Encrypt("Mmol15052000#");
            bool    isLog           = queryDB.IsLog("*****@*****.**", passwordAccount);

            Assert.IsTrue(isLog);
        }