public ConvertFrom ( ITypeDescriptorContext context, |
||
context | ITypeDescriptorContext | Additional context for conversion. |
culture | The culture to use for conversion. | |
value | object | The |
리턴 | object |
public void ConvertShortFormToReinstallModes() { var converter = new ReinstallModesConverter(); Assert.IsTrue(converter.CanConvertFrom(typeof(string))); var mode = (ReinstallModes)converter.ConvertFrom("omUS"); Assert.AreEqual(Default, mode); }
public void ConvertInvalidStringToReinstallModes() { var converter = new ReinstallModesConverter(); Assert.IsTrue(converter.CanConvertFrom(typeof(string))); // Should throw ArgumentException. var mode = (ReinstallModes)converter.ConvertFrom("xyz"); }
public void ConvertNamesToReinstallModes() { var converter = new ReinstallModesConverter(); Assert.IsTrue(converter.CanConvertFrom(typeof(string))); // Use mixed case to test case-insensitivity. var mode = (ReinstallModes)converter.ConvertFrom("FileOlderVersion, MachineData, userData, shortcut"); Assert.AreEqual(Default, mode); }
public void ConvertInvalidStringToReinstallModes() { var converter = new ReinstallModesConverter(); Assert.IsTrue(converter.CanConvertFrom(typeof(string))); // Should throw ArgumentException. var mode = (ReinstallModes)converter.ConvertFrom("xyz"); }
public void ConvertShortFormToReinstallModes() { var converter = new ReinstallModesConverter(); Assert.IsTrue(converter.CanConvertFrom(typeof(string))); var mode = (ReinstallModes)converter.ConvertFrom("omUS"); Assert.AreEqual(Default, mode); }
public void ConvertNamesToReinstallModes() { var converter = new ReinstallModesConverter(); Assert.IsTrue(converter.CanConvertFrom(typeof(string))); // Use mixed case to test case-insensitivity. var mode = (ReinstallModes)converter.ConvertFrom("FileOlderVersion, MachineData, userData, shortcut"); Assert.AreEqual(Default, mode); }