private static HashSet <SkillNode> DecodeInSkillTree(string buildUrl) { // SkillTree.DecodeUrl accesses static state that should be reset between tests SkillTree.ClearAssets(); _tree = SkillTree.CreateAsync(_persistentData).Result; HashSet <SkillNode> nodes; SkillTree.DecodeUrl(buildUrl, out nodes, _tree); return(nodes); }
public async Task FullPoeplannerTreeLoadUnloadTest() { var build = _builds.FindByName("PoeplannerFullTreeWithMaxScionAndBandits"); SkillTree.ClearAssets(); SkillTree tree = await SkillTree.CreateAsync(_persistentData); tree.LoadFromUrl(build.DefaultUrl); var actualUrl = new SkillTreeSerializer(tree).ToUrl(); Assert.AreEqual(build.GetAlternativeUrl("pathofexile"), actualUrl); }
public async Task GetPointCountTest() { var build = _builds.FindByName("PoeplannerWitchOccultistAscendant"); var targetUrl = build.GetAlternativeUrl("pathofexileWindowed"); // Need instance created in current thread for a WPF UI logic SkillTree.ClearAssets(); SkillTree tree = await SkillTree.CreateAsync(_persistentData); tree.LoadFromUrl(targetUrl); var deserializer = _tree.BuildConverter.GetUrlDeserializer(targetUrl); var points = tree.GetPointCount(); var count = points["NormalUsed"] + points["AscendancyUsed"] + points["ScionAscendancyChoices"]; Assert.AreEqual(count, deserializer.GetPointsCount(true)); }
public async Task SaveToUrlNoAscendancyPointsTest() { var build = _builds.FindByName("PathofexilWitchOccultist"); var targetUrl = build.DefaultUrl; string expectedSegment = targetUrl.Split('/').LastOrDefault(); // Need new instance created in current thread for a WPF UI logic SkillTree.ClearAssets(); SkillTree tree = await SkillTree.CreateAsync(_persistentData); tree.LoadFromUrl(targetUrl); var actualSegment = tree.Serializer.ToUrl().Split('/').LastOrDefault(); Assert.AreEqual(expectedSegment, actualSegment); SkillTree.ClearAssets(); }
public async Task SaveToUrlTest() { var build = _builds.FindByName("PoeplannerWitchOccultistAscendant"); var targetUrl = build.GetAlternativeUrl("pathofexileWindowed"); string expectedUrl = targetUrl.Split('/').LastOrDefault(); // Need instance created in current thread for a WPF UI logic SkillTree.ClearAssets(); SkillTree tree = await SkillTree.CreateAsync(_persistentData); tree.LoadFromUrl(targetUrl); var actualUrl = tree.Serializer.ToUrl().Split('/').LastOrDefault(); Assert.AreEqual(expectedUrl, actualUrl); SkillTree.ClearAssets(); }
public void TestCleanup() { SkillTree.ClearAssets(); }