public SingleRugbyMatchController()
        {
            var client    = new APIRestClient("http://test-api.statrugby.com/");
            var dataStore = new StoreData();
            var readWrite = new StoreReadWrite(dataStore);

            service = new FetchService(client, dataStore, readWrite);
        }
Пример #2
0
        public void GetAllMatchForSeasonEndyearLessThanStartTest()
        {
            var client = new APIRestClient("http://test-api.statrugby.com/");

            var result = client.GetAllMatchesForSeason(2020, 2019, 103969);

            Assert.IsNull(result);
        }
Пример #3
0
        public void GetAllMatchesForSeasonNonExistantTeamTest()
        {
            var client = new APIRestClient("http://test-api.statrugby.com/");

            var result = client.GetAllMatchesForSeason(2019, 2020, 5);

            Assert.IsNull(result);
        }
Пример #4
0
        public void GetAllMatchForSeasonTest()
        {
            var client = new APIRestClient("http://test-api.statrugby.com/");

            var result = client.GetAllMatchesForSeason(2019, 2020, 103969);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
            Assert.AreEqual(22, result.Count());
        }
Пример #5
0
    public void DeleteTrunk()
    {
        APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient;

        int id = PlayerPrefs.GetInt("trunkId");

        StartCoroutine(apiRestClient.DeleteThematic(id));

        Destroy(GameObject.Find("Trunk(Clone)-id" + id));
    }
Пример #6
0
    public void DeleteBranch()
    {
        APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient;

        int id = PlayerPrefs.GetInt("branchId");

        StartCoroutine(apiRestClient.DeleteCategory(id));

        Destroy(GameObject.Find("Branch1(Clone)-id" + id));
    }
Пример #7
0
    public void GetArticles(string query)
    {
        DestroyPrevForest();
        PlayerPrefs.SetString("query", query);
        PlayerPrefs.SetInt("fromMain", 1);

        APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient;

        StartCoroutine(apiRestClient.SearchArticle(query));

        SetStatus(StatusBuildTree.Init);
    }
Пример #8
0
        public void GetAllMatchesForSeasonYearInvalidTest()
        {
            var client = new APIRestClient("http://test-api.statrugby.com/");

            var result = client.GetAllMatchesForSeason(1, 2020, 103969);

            Assert.IsNull(result);


            var result1 = client.GetAllMatchesForSeason(2019, 1, 103969);

            Assert.IsNull(result1);
        }
Пример #9
0
    public void DeleteLeaf()
    {
        APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient;

        int id = PlayerPrefs.GetInt("leafId");

        StartCoroutine(apiRestClient.DeleteArticle(id));

        GameObject[] leavesWithTag = GameObject.FindGameObjectsWithTag("Leaf");

        foreach (GameObject leafWithTag in leavesWithTag)
        {
            if (leafWithTag.name == "Leaf3(Clone)-id" + id)
            {
                Destroy(leafWithTag);
            }
        }
    }
Пример #10
0
    void GetThematic(CategorySerializable branch)
    {
        APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient;

        StartCoroutine(apiRestClient.GetThematics(branch.thematic_link));
    }
Пример #11
0
    void GetCategories(ArticleSerializable leaf)
    {
        APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient;

        StartCoroutine(apiRestClient.GetCategories(leaf.categories_link));
    }
Пример #12
0
 public void GivenIAmInPage(string url)
 {
     _client = new APIRestClient(url);
 }