public void EncodingSettingDefinition_ConvertFromString_ReturnsEncoding() { var definition = new EncodingSettingDefinition("test", "desc", Encoding.Default); var encoding = Encoding.UTF32; var converted = definition.ConvertFromString(encoding.HeaderName); Assert.Equal(encoding, converted); }
public void EncodingSettingDefinition_ConvertToString_ReturnsHeaderName() { var definition = new EncodingSettingDefinition("test", "desc", Encoding.Default); var encoding = Encoding.UTF32; var str = definition.ConvertToString(encoding); Assert.Equal(encoding.HeaderName, str); }
public void EncodingSettingDefinition_Constructor_PopulatesProperties() { var definition = new EncodingSettingDefinition("test", "desc", Encoding.UTF32, SettingScopeEnum.Application); Assert.Equal("test", definition.Name); Assert.Equal("desc", definition.Description); Assert.Equal(Encoding.UTF32.HeaderName, definition.DefaultValue); Assert.Equal(SettingScopeEnum.Application, definition.Scope); }
public void EncodingSettingDefinition_GetValues_ReturnsPossibleValues() { var definition = new EncodingSettingDefinition("test", "desc", Encoding.Default); var values = definition.GetValues(); Assert.NotNull(values); Assert.NotEmpty(values); foreach (var name in values) { Assert.NotNull(Encoding.GetEncoding(name)); } }