public void TestEquals_TelescopeIdDifferent_NotEqual()
        {
            SensorNetworkConfig config = new SensorNetworkConfig(5);
            SensorNetworkConfig other  = new SensorNetworkConfig(6);

            Assert.IsFalse(config.Equals(other));
        }
Пример #2
0
        public void TestUpdateSensorNetworkConfig_ChangeAllFields_UpdatesConfig()
        {
            int telescopeId = 5;
            SensorNetworkConfig original = new SensorNetworkConfig(telescopeId);

            // Save original config
            DatabaseOperations.AddSensorNetworkConfig(original);

            // Change values so the updated one is different
            original.ElevationTemp1Init              = false;
            original.AzimuthTemp1Init                = false;
            original.ElevationAccelerometerInit      = false;
            original.AzimuthAccelerometerInit        = false;
            original.CounterbalanceAccelerometerInit = false;
            original.ElevationEncoderInit            = false;
            original.AzimuthEncoderInit              = false;
            original.TimeoutDataRetrieval            = 5;
            original.TimeoutInitialization           = 5;

            // Update config
            DatabaseOperations.UpdateSensorNetworkConfig(original);

            var retrieved = DatabaseOperations.RetrieveSensorNetworkConfigByTelescopeId(telescopeId);

            Assert.IsTrue(original.Equals(retrieved));

            // Delete config
            DatabaseOperations.DeleteSensorNetworkConfig(original);
        }
        public void TestEquals_Identical_Equal()
        {
            int telescopeId = 5;

            SensorNetworkConfig config = new SensorNetworkConfig(telescopeId);

            SensorNetworkConfig other = new SensorNetworkConfig(telescopeId);

            Assert.IsTrue(config.Equals(other));
        }
        public void TestEquals_AzimuthTemp1InitDifferent_NotEqual()
        {
            int telescopeId = 5;

            SensorNetworkConfig config = new SensorNetworkConfig(telescopeId);
            SensorNetworkConfig other  = new SensorNetworkConfig(telescopeId);

            other.AzimuthTemp1Init = false;

            Assert.IsFalse(config.Equals(other));
        }
        public void TestEquals_TimeoutInitializationDifferent_NotEqual()
        {
            int telescopeId = 5;

            SensorNetworkConfig config = new SensorNetworkConfig(telescopeId);
            SensorNetworkConfig other  = new SensorNetworkConfig(telescopeId);

            other.TimeoutInitialization = 5;

            Assert.IsFalse(config.Equals(other));
        }
        public void TestEquals_TimeoutDataRetrievalDifferent_NotEqual()
        {
            int telescopeId = 5;

            SensorNetworkConfig config = new SensorNetworkConfig(telescopeId);
            SensorNetworkConfig other  = new SensorNetworkConfig(telescopeId);

            other.TimeoutDataRetrieval = 5;

            Assert.IsFalse(config.Equals(other));
        }
        public void TestEquals_ElevationEncoderInitDifferent_NotEqual()
        {
            int telescopeId = 5;

            SensorNetworkConfig config = new SensorNetworkConfig(telescopeId);
            SensorNetworkConfig other  = new SensorNetworkConfig(telescopeId);

            other.ElevationEncoderInit = false;

            Assert.IsFalse(config.Equals(other));
        }
        public void TestEquals_CounterbalanceAccelerometerInitDifferent_NotEqual()
        {
            int telescopeId = 5;

            SensorNetworkConfig config = new SensorNetworkConfig(telescopeId);
            SensorNetworkConfig other  = new SensorNetworkConfig(telescopeId);

            other.CounterbalanceAccelerometerInit = false;

            Assert.IsFalse(config.Equals(other));
        }
Пример #9
0
        public void TestAddAndRetrieveSensorNetworkConfig_Valid_CreatesConfig()
        {
            int telescopeId = 5;

            // Create new SensorNetworkConfig with a telescope ID of 5
            SensorNetworkConfig original = new SensorNetworkConfig(telescopeId);

            original.TimeoutDataRetrieval  = 5;
            original.TimeoutInitialization = 5;

            DatabaseOperations.AddSensorNetworkConfig(original);

            var retrieved = DatabaseOperations.RetrieveSensorNetworkConfigByTelescopeId(telescopeId);

            Assert.IsTrue(original.Equals(retrieved));

            // Delete config
            DatabaseOperations.DeleteSensorNetworkConfig(original);
        }