public void ConvertsCorrectly() { File.Delete(cwd + @"\mapping\mapping.json"); try { Cartographer cart = new Cartographer(); cart.Convert(cwd + @"\mapping"); //converts and autosaves the converted map cart.Load(cwd + @"\mapping"); //loads the map List <string> rawmap = File.ReadAllLines(cwd + @"\mapping\map.csv").ToList(); for (int y = 0; y < rawmap.Count(); y++) { //break up line List <string> valuesList = rawmap[y].Split(',').ToList(); for (int x = 0; x < valuesList.Count(); x++) { //convert value to ushort, then create MapPoint Assert.AreEqual(Convert.ToInt32(valuesList[x]), cart.GetPoint(x, y).GetOccupancy()); } } } catch (Exception e) { Assert.Fail("Should not crash: {0}", e.ToString()); } }
public void LoadDoesntCrash() { try { Cartographer cart = new Cartographer(); cart.Load(@"./"); } catch (Exception e) { Assert.Fail("Should not crash: {0}", e.ToString()); } }