public CoordinateTransformationEPSGFactoryTest()
        {
            IDbConnection connection = Global.GetEPSGDatabaseConnection();

            _CTfactory  = new CoordinateTransformationEPSGFactory(connection);
            _CRSfactory = new CoordinateSystemEPSGFactory(connection);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the CoordinateTransformationEPSGFactory class.
 /// </summary>
 public CoordinateTransformationEPSGFactory(IDbConnection databaseConnection)
 {
     if (databaseConnection == null)
     {
         throw new ArgumentNullException("databaseConnection");
     }
     _databaseConnection = databaseConnection;
     _coordSystemFactory = new CoordinateSystemEPSGFactory(databaseConnection);
 }
        /*
         * [Ignore("EPSG is not in the bin directory, so will fail")]
         * public void Test_Constructor2()
         * {
         *      CoordinateSystemEPSGFactory factory = CoordinateSystemEPSGFactory.UseDefaultDatabase();
         *      ILinearUnit linearUnit = factory.CreateLinearUnit("9001");
         *      Assertion.AssertEquals("LinearUnit - untis per meter ",1.0,linearUnit.MetersPerUnit);
         *      Assertion.AssertEquals("LinearUnit - Authority","EPSG",linearUnit.Authority);
         *      Assertion.AssertEquals("LinearUnit - Remarks","Also known as International metre.",linearUnit.Remarks);
         * }*/


        public void Test_TestAccessDB()
        {
            IDbConnection connection            = Global.GetEPSGDatabaseConnection();
            CoordinateSystemEPSGFactory factory = new CoordinateSystemEPSGFactory(connection);
            ILinearUnit linearUnit = factory.CreateLinearUnit("9001");

            Assertion.AssertEquals("LinearUnit - untis per meter ", 1.0, linearUnit.MetersPerUnit);
            Assertion.AssertEquals("LinearUnit - Authority", "EPSG", linearUnit.Authority);
            Assertion.AssertEquals("LinearUnit - Remarks", "Also known as International metre.", linearUnit.Remarks);
            connection.Close();
        }
 public void Test_Constructor1()
 {
     try
     {
         CoordinateSystemEPSGFactory factory = new CoordinateSystemEPSGFactory(null);
         Assertion.Fail("ArgumentNullException should be thrown");
     }
     catch (ArgumentNullException)
     {
     }
 }
        public void Test_TestSqlServer()
        {
            string        connectionString = @"initial catalog=EPSG;data source=localhost;Integrated Security=SSPI;";
            SqlConnection connection       = new SqlConnection(connectionString);

            CoordinateSystemEPSGFactory factory = new CoordinateSystemEPSGFactory(connection);
            ILinearUnit linearUnit = factory.CreateLinearUnit("9001");

            Assertion.AssertEquals("LinearUnit - untis per meter ", 1.0, linearUnit.MetersPerUnit);
            Assertion.AssertEquals("LinearUnit - Authority", "EPSG", linearUnit.Authority);
            Assertion.AssertEquals("LinearUnit - Remarks", "Also known as International metre.", linearUnit.Remarks);
            connection.Close();
        }
 public void Init()
 {
     _factory = new CoordinateSystemEPSGFactory(Global.GetEPSGDatabaseConnection());
 }
Exemplo n.º 7
0
		public CompoundCoordinateSystemTest()
		{
			_factory = new CoordinateSystemEPSGFactory(Global.GetEPSGDatabaseConnection());
		}