diff --git a/src/Twilio/Constant/EnumConstants.cs b/src/Twilio/Constant/EnumConstants.cs new file mode 100644 index 000000000..9a9332e28 --- /dev/null +++ b/src/Twilio/Constant/EnumConstants.cs @@ -0,0 +1,17 @@ +using Newtonsoft.Json; +using Twilio.Converters; +using Twilio.Types; + +namespace Twilio.Constant +{ + public class EnumConstants + { + [JsonConverter(typeof(StringEnumConverter))] + public sealed class ContentTypeEnum : StringEnum + { + private ContentTypeEnum(string value) : base(value) {} + public static readonly ContentTypeEnum JSON = new ContentTypeEnum("application/json"); + public static readonly ContentTypeEnum FORM_URLENCODED = new ContentTypeEnum("application/x-www-form-urlencoded"); + } + } +} diff --git a/test/Twilio.Test/Constant/EnumConstantsTest.cs b/test/Twilio.Test/Constant/EnumConstantsTest.cs new file mode 100644 index 000000000..af1b70683 --- /dev/null +++ b/test/Twilio.Test/Constant/EnumConstantsTest.cs @@ -0,0 +1,20 @@ +using NUnit.Framework; +using Twilio.Constant; + +namespace Twilio.Tests.Constant +{ + [TestFixture] + public class EnumConstantsTest + { + + [Test] + public void EnumConstantComparison() + { + var jsonContentType = EnumConstants.ContentTypeEnum.JSON; + var formUrlEncodedType = EnumConstants.ContentTypeEnum.FORM_URLENCODED; + + Assert.AreEqual("application/json", jsonContentType.ToString()); + Assert.AreEqual("application/x-www-form-urlencoded", formUrlEncodedType.ToString()); + } + } +} \ No newline at end of file