public void ConfigurableLtoFLashFeature_CreateFeature_HasCorrectCurrentValue() { var defaultValue = -3; var feature = new ConfigurableTestLtoFlashIntFeature("CreateCheckCurrentValue", defaultValue); Assert.Equal(defaultValue, feature.CurrentValue); }
public void ReadOnlyConfigurableLtoFlashFeature_UpdateCurrentValue_ThrowsInvalidOperationException() { var feature = ConfigurableTestLtoFlashIntFeature.CreateReadOnly(); var newStatusFlags = ConfigurableTestLtoFlashIntFeature.CreateFlagsMask(987); Assert.Throws <InvalidOperationException>(() => feature.UpdateCurrentValue(newStatusFlags)); }
public void ConfigurableLtoFLashFeature_CreateFeature_HasExpectedFlagsMask() { var defaultValue = 0x0C0C0C0C; var feature = new ConfigurableTestLtoFlashIntFeature("CreateCheckFlagsMask", defaultValue); var expectedFeatureFlagsMask = ConfigurableTestLtoFlashIntFeature.CreateFlagsMask(defaultValue); Assert.Equal(expectedFeatureFlagsMask, feature.FeatureFlagsMask); }
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); }
public void ConfigurableLtoFlashFeature_SetValueOnDeviceWithNullDevice_ThrowsNullReferenceException() { var feature = new ConfigurableTestLtoFlashIntFeature("SetValueOnDeviceWithNullDevice", 1); Assert.Throws <NullReferenceException>(() => feature.SetValueOnDevice(null, 3)); }
public void ReadOnlyConfigurableLtoFlashFeature_SetValueOnDevice_ThrowsInvalidOperationException() { var feature = ConfigurableTestLtoFlashIntFeature.CreateReadOnly(); Assert.Throws <InvalidOperationException>(() => feature.SetValueOnDevice(null, 6)); }