public void CanGetBoolFromIntToFalse() { string boolString = 0.ToString(); var boolValue = SettingConverter.GetTFromString <bool>(boolString); Assert.False(boolValue); }
public void CanGetBoolFromTrueString() { string boolString = bool.TrueString; var boolValue = SettingConverter.GetTFromString <bool>(boolString); Assert.True(boolValue); }
public void CanGetBoolFromFalseStringLowerCase() { string boolString = bool.FalseString.ToLower(); var boolValue = SettingConverter.GetTFromString <bool>(boolString); Assert.False(boolValue); }
public void CanGetEnumValueByValue() { const string none = "0"; var value = SettingConverter.GetTFromString <OSEnum>(none); Assert.Equal(OSEnum.None, value); }
public void CanGetUri() { const string url = "http://mydomain.com/"; var value = SettingConverter.GetTFromString <Uri>(url); Assert.Equal(url, value.ToString()); }
public void CanGetDateTime() { string now = DateTime.Now.ToString(); var value = SettingConverter.GetTFromString <DateTime>(now); Assert.Equal(now, value.ToString()); }
public void CanGetInt() { string now = 5.ToString(); var value = SettingConverter.GetTFromString <int>(now); Assert.Equal(now, value.ToString()); }
public void CanGetEnumValueByFlagString() { const OptionsEnum all = (OptionsEnum.A | OptionsEnum.B | OptionsEnum.C); string allString = all.ToString(); var value = SettingConverter.GetTFromString <OptionsEnum>(allString); Assert.Equal(all, value); }