コード例 #1
0
ファイル: CSVParser.cs プロジェクト: deanogorman/EF_Project
        List<Models.Parking> IDataParser.parseParking(String parkingtype)
        {
            CsvReader csv = new CsvReader(reader, true);
            int fieldCount = csv.FieldCount;

            List<Parking> facility = new List<Parking>();

            String[] headers = csv.GetFieldHeaders();

            while (csv.ReadNextRecord())
            {
                Parking exObj = new Parking();

                for (int i = 0; i < fieldCount; i++)
                { // need to make this more robust for non expected values
                    if (headers[i].Equals("AREA_DESC")) {
                        exObj.AreaDesc = csv[i];
                    } else if (headers[i].Equals("ROADNAME")) {
                        exObj.RoadName = csv[i];
                    } else if (headers[i].Equals("TOTAL_SPACES")) {
                        exObj.TotalSpaces = csv[i];
                    } else if (headers[i].Equals("LAT")) {
                        exObj.Latitude = Convert.ToDouble(csv[i]);
                    } else if (headers[i].Equals("LONG")) {
                        exObj.Longtitude = Convert.ToDouble(csv[i]);
                    }
                }
                exObj.Description = parkingtype;
                facility.Add(exObj);
            }
            return facility;
        }
コード例 #2
0
ファイル: ParkingTest.cs プロジェクト: Tamakloe/EF_Project
 public void LongitudeTest()
 {
     Parking target = new Parking(); // TODO: Initialize to an appropriate value
     double expected = 0F; // TODO: Initialize to an appropriate value
     double actual;
     target.Longitude = expected;
     actual = target.Longitude;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
コード例 #3
0
ファイル: ParkingTest.cs プロジェクト: Tamakloe/EF_Project
 public void ParkingIDTest()
 {
     Parking target = new Parking(); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     target.ParkingID = expected;
     actual = target.ParkingID;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
コード例 #4
0
ファイル: ParkingTest.cs プロジェクト: Tamakloe/EF_Project
 public void TotalSpacesTest()
 {
     Parking target = new Parking(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.TotalSpaces = expected;
     actual = target.TotalSpaces;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }