Exemplo n.º 1
0
        private static void AssertReadHydraulicBoundaryDatabase(ReadHydraulicBoundaryDatabase readHydraulicBoundaryDatabase)
        {
            Assert.AreEqual("Dutch coast South19-11-2015 12:0013", readHydraulicBoundaryDatabase.Version);
            Assert.AreEqual((long)13, readHydraulicBoundaryDatabase.TrackId);
            Assert.AreEqual(18, readHydraulicBoundaryDatabase.Locations.Count());

            ReadHydraulicBoundaryLocation location = readHydraulicBoundaryDatabase.Locations.First();

            Assert.AreEqual(1, location.Id);
            Assert.AreEqual("punt_flw_ 1", location.Name);
            Assert.AreEqual(52697.5, location.CoordinateX);
            Assert.AreEqual(427567.0, location.CoordinateY);
        }
Exemplo n.º 2
0
        public void Constructor_Always_ExpectedValues()
        {
            // Setup
            const long   id          = 1;
            const string name        = "name";
            var          random      = new Random(11);
            double       xCoordinate = random.NextDouble();
            double       yCoordinate = random.NextDouble();

            // Call
            var readHydraulicBoundaryLocation = new ReadHydraulicBoundaryLocation(id, name, xCoordinate, yCoordinate);

            // Assert
            Assert.AreEqual(id, readHydraulicBoundaryLocation.Id);
            Assert.AreEqual(name, readHydraulicBoundaryLocation.Name);
            Assert.AreEqual(xCoordinate, readHydraulicBoundaryLocation.CoordinateX);
            Assert.AreEqual(yCoordinate, readHydraulicBoundaryLocation.CoordinateY);
        }
        public void Read_ValidFile_ReturnsReadHydraulicBoundaryDatabase()
        {
            // Setup
            string hydraulicBoundaryDatabaseFile = Path.Combine(testDataPath, "complete.sqlite");

            using (var reader = new HydraulicBoundaryDatabaseReader(hydraulicBoundaryDatabaseFile))
            {
                // Call
                ReadHydraulicBoundaryDatabase readDatabase = reader.Read();

                // Assert
                Assert.AreEqual("Dutch coast South19-11-2015 12:0013", readDatabase.Version);
                Assert.AreEqual(13, readDatabase.TrackId);
                Assert.AreEqual(18, readDatabase.Locations.Count());
                ReadHydraulicBoundaryLocation location = readDatabase.Locations.First();
                Assert.AreEqual(1, location.Id);
                Assert.AreEqual("punt_flw_ 1", location.Name);
                Assert.AreEqual(52697.5, location.CoordinateX);
                Assert.AreEqual(427567.0, location.CoordinateY);
            }
        }