Ejemplo n.º 1
0
        public void TestLoadLocationList_EmptyWaypointFile()
        {
            // set up
            string filename = Path.Combine(UnitTestHelper.TestAssetsPath, "waypoints-empty.cup");

            using (var stream = new FileStream(filename, FileMode.Open))
            {
                // run
                var cupFile = new SeeYouDataFile(stream);

                // check
                Assert.IsFalse(cupFile.HasLocations(), "loaded file must have no locations");
                Assert.IsFalse(cupFile.LoadLocationList().Any(), "locations list must contain no locations");
            }
        }
Ejemplo n.º 2
0
        public void TestLoadLocationList_WaypointVariants()
        {
            // set up
            string filename = Path.Combine(UnitTestHelper.TestAssetsPath, "waypoints-variants.cup");

            using (var stream = new FileStream(filename, FileMode.Open))
            {
                // run
                var cupFile = new SeeYouDataFile(stream);

                var locationsList = cupFile.LoadLocationList();

                // check
                Assert.IsTrue(cupFile.HasLocations(), "loaded file must have locations");
                Assert.AreEqual(4, locationsList.Count, "locations list must contain correct number of locations");
            }
        }