예제 #1
0
        public void ConfigurableLtoFLashFeature_CreateFeature_HasCorrectCurrentValue()
        {
            var defaultValue = -3;

            var feature = new ConfigurableTestLtoFlashIntFeature("CreateCheckCurrentValue", defaultValue);

            Assert.Equal(defaultValue, feature.CurrentValue);
        }
예제 #2
0
        public void ReadOnlyConfigurableLtoFlashFeature_UpdateCurrentValue_ThrowsInvalidOperationException()
        {
            var feature = ConfigurableTestLtoFlashIntFeature.CreateReadOnly();

            var newStatusFlags = ConfigurableTestLtoFlashIntFeature.CreateFlagsMask(987);

            Assert.Throws <InvalidOperationException>(() => feature.UpdateCurrentValue(newStatusFlags));
        }
예제 #3
0
        public void ConfigurableLtoFLashFeature_CreateFeature_HasExpectedFlagsMask()
        {
            var defaultValue = 0x0C0C0C0C;

            var feature = new ConfigurableTestLtoFlashIntFeature("CreateCheckFlagsMask", defaultValue);

            var expectedFeatureFlagsMask = ConfigurableTestLtoFlashIntFeature.CreateFlagsMask(defaultValue);

            Assert.Equal(expectedFeatureFlagsMask, feature.FeatureFlagsMask);
        }
예제 #4
0
        public void ConfigurableLtoFlashFeature_UpdateCurrentValue_UpdatesValueWithExpectedValueChangedResult(int defaultValue, int newFlags, bool expectedValueChanged)
        {
            var feature = new ConfigurableTestLtoFlashIntFeature("UpdateCurrentValue", defaultValue);

            var newStatusFlags = ConfigurableTestLtoFlashIntFeature.CreateFlagsMask(newFlags);
            var valueChanged   = feature.UpdateCurrentValue(newStatusFlags);

            var expectedNewValue = (int)(newStatusFlags & feature.FeatureFlagsMask).Lo;

            Assert.Equal(expectedNewValue, feature.CurrentValue);
            Assert.Equal(expectedValueChanged, valueChanged);
        }
예제 #5
0
        public void ConfigurableLtoFlashFeature_SetValueOnDeviceWithNullDevice_ThrowsNullReferenceException()
        {
            var feature = new ConfigurableTestLtoFlashIntFeature("SetValueOnDeviceWithNullDevice", 1);

            Assert.Throws <NullReferenceException>(() => feature.SetValueOnDevice(null, 3));
        }
예제 #6
0
        public void ReadOnlyConfigurableLtoFlashFeature_SetValueOnDevice_ThrowsInvalidOperationException()
        {
            var feature = ConfigurableTestLtoFlashIntFeature.CreateReadOnly();

            Assert.Throws <InvalidOperationException>(() => feature.SetValueOnDevice(null, 6));
        }