示例#1
0
        public void WriteJson()
        {
            StationLocationList stations = new StationLocationList();

            stations.list = new List <StationLocation>()
            {
                new StationLocation(1001, 0.8, 0.4),
                new StationLocation(1002, 0.1, 0.2)
            };
            Assert.AreEqual(true, LocationHandler.setStationLocations(stations));
        }
示例#2
0
        public void ReadJson()
        {
            bool expect = true;
            bool actual = false;

            try
            {
                StationLocationList stations = LocationHandler.getStationLocations();
                actual = stations.list[0].stationId == 1001 ? true : false;
            }
            catch (Exception e)
            {
                actual = false;
            }
            Assert.AreEqual(expect, actual);
        }