Beispiel #1
0
        public void ReInitCardTest()
        {
            IArcoServer host           = new ArcoSQLLiteServer(@"arcomageDB.db");
            string      cardFromServer = host.GetRandomCard();
            Card        result         = JsonConvert.DeserializeObject <List <Card> >(cardFromServer).FirstOrDefault();

            Assert.IsNotNull(result.cardAttributes, "Не должно быть пустым атрибуты");
            Assert.IsNotNull(result.price, "Не должно быть пустым цена");
        }
Beispiel #2
0
        public void SqliteDBTest()
        {
            IArcoServer host           = new ArcoSQLLiteServer(@"arcomageDB.db");
            string      cardFromServer = host.GetRandomCard();
            List <Card> result         = JsonConvert.DeserializeObject <List <Card> >(cardFromServer);

            Assert.AreEqual(result.Count, 102, "Должно быть 102 карты");
            Assert.AreNotEqual(result.First().id, 2, "Первой картой не должна быть карта 2");
        }
Beispiel #3
0
        public void SpecialSymbolsInCard2Test()
        {
            IArcoServer host           = new ArcoSQLLiteServer(@"arcomageDB.db");
            string      cardFromServer = host.GetRandomCard();
            List <Card> result         = JsonConvert.DeserializeObject <List <Card> >(cardFromServer);
            string      description    = "";

            foreach (var item in result.Where(x => x.id == 8))
            {
                description = ParseDescription.Parse(item.description);
            }

            Assert.AreEqual(description.IndexOf("&"), -1, "Не должно быть знаков амперсант");
        }
Beispiel #4
0
        public void TestSpecialCardFromServer()
        {
            int         countDesc      = 0;
            IArcoServer host           = new ArcoSQLLiteServer(@"arcomageDB.db");
            string      cardFromServer = host.GetRandomCard();
            List <Card> result         = JsonConvert.DeserializeObject <List <Card> >(cardFromServer);

            foreach (var item in result)
            {
                string description = ParseDescription.Parse(item.description);

                if (item.description.Length > 0 && description.Length == 0)
                {
                    countDesc++;
                    Console.WriteLine("item " + item.name + " has no descript. Original text: " + Environment.NewLine + item.description + Environment.NewLine);
                }
            }

            Assert.AreEqual(countDesc, 0, "Не должно быть карт с отсутствующим описанием");
        }
Beispiel #5
0
    private void StartNewGame()
    {
        GameIsOver = false;

        string filePath = GetStreamingAssetsPath("arcomageDB.db");
        var    newServe = new ArcoSQLLiteServer(filePath);

        Debug.LogWarning("newServe.Path: " + newServe.connectionPath);
        gm = new GameController(this, newServe);

        gm.AddPlayer(TypePlayer.Human, "Human");
        gm.AddPlayer(TypePlayer.AI, "Computer");

        Dictionary <string, object> notify = new Dictionary <string, object> ();

        notify.Add("CurrentAction", CurrentAction.StartGame);
        notify.Add("currentPlayer", TypePlayer.Human);

//				notify.Add ("CardTricksters", new List<int> { 39, 11, 12, 13, 14, 15 });


        gm.SendGameNotification(notify);
    }