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); }
public void GetAllMatchForSeasonEndyearLessThanStartTest() { var client = new APIRestClient("http://test-api.statrugby.com/"); var result = client.GetAllMatchesForSeason(2020, 2019, 103969); Assert.IsNull(result); }
public void GetAllMatchesForSeasonNonExistantTeamTest() { var client = new APIRestClient("http://test-api.statrugby.com/"); var result = client.GetAllMatchesForSeason(2019, 2020, 5); Assert.IsNull(result); }
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()); }
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)); }
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)); }
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); }
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); }
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); } } }
void GetThematic(CategorySerializable branch) { APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient; StartCoroutine(apiRestClient.GetThematics(branch.thematic_link)); }
void GetCategories(ArticleSerializable leaf) { APIRestClient apiRestClient = ScriptableObject.CreateInstance("APIRestClient") as APIRestClient; StartCoroutine(apiRestClient.GetCategories(leaf.categories_link)); }
public void GivenIAmInPage(string url) { _client = new APIRestClient(url); }