public void TestSensorNetworkClient_InitializationExistingTelescope_LoadsExistingConfig()
        {
            // Config should exist
            var retrievedConfig = DatabaseOperations.RetrieveSensorNetworkConfigByTelescopeId(TelescopeId);

            // Create new client which will pull an existing config
            SensorNetworkClient existingClient = new SensorNetworkClient(IpAddress, Port, TelescopeId);

            // Config should exist and be equal to the one in the client
            Assert.IsTrue(retrievedConfig.Equals(existingClient.SensorNetworkConfig));
        }
        public void TestSensorNetworkClient_InitializationNewTelescope_CreatesNewConfig()
        {
            int newTelescopeId = 10;

            // Config should not exist
            var retrievedConfig = DatabaseOperations.RetrieveSensorNetworkConfigByTelescopeId(newTelescopeId);

            Assert.IsNull(retrievedConfig);

            // Create new client, which will create a new config for the telescope ID if it doesn't exist
            SensorNetworkClient newClient = new SensorNetworkClient(IpAddress, Port, newTelescopeId);

            // Config should now exist and be equal to the one in the client
            retrievedConfig = DatabaseOperations.RetrieveSensorNetworkConfigByTelescopeId(newTelescopeId);
            Assert.IsTrue(retrievedConfig.Equals(newClient.SensorNetworkConfig));

            // Delete config after use
            DatabaseOperations.DeleteSensorNetworkConfig(retrievedConfig);
        }
 public void Initialize()
 {
     client = new SensorNetworkClient(IpAddress, Port, TelescopeId);
 }