public void GetValueString_InvalidString_ThrowsException() { string section = string.Empty; string name = string.Empty; string value = "1"; SiteOption.SiteOptionType type = SiteOption.SiteOptionType.Bool; string description = string.Empty; SiteOption target = new SiteOption(DEFAULT_SITE_ID, section, name, value, type, description); try { target.GetValueString(); throw new Exception("GetValueString should throw exception"); } catch (SiteOptionInvalidTypeException) { } }
public void GetValueString_ValidString_ReturnsString() { string section = string.Empty; string name = string.Empty; string value = "1"; SiteOption.SiteOptionType type = SiteOption.SiteOptionType.String; string description = string.Empty; SiteOption target = new SiteOption(DEFAULT_SITE_ID, section, name, value, type, description); string expected = "1"; string actual = target.GetValueString(); Assert.AreEqual(expected, actual); }