public void Construct_ResponseTypeConstructor_ResponseTypeSuccess() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Success); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Success, sut.ResponseType); }
public void Construct_DefaultConstructor_ResponseTypeAny() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); }
public void ValidateResponseCode_IIS_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(440)); Assert.IsTrue(sut.ValidateResponseCode(449)); Assert.IsTrue(sut.ValidateResponseCode(451)); }
public void ValidateResponseCode_Information_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(100)); Assert.IsTrue(sut.ValidateResponseCode(101)); Assert.IsTrue(sut.ValidateResponseCode(102)); Assert.IsTrue(sut.ValidateResponseCode(103)); }
public void ValidateResponseCode_IIS_ResponseTypeIIS_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.IIS); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.IIS, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(440)); Assert.IsTrue(sut.ValidateResponseCode(449)); Assert.IsTrue(sut.ValidateResponseCode(451)); Assert.IsFalse(sut.ValidateResponseCode(404)); }
public void ValidateResponseCode_Nginx_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(444)); Assert.IsTrue(sut.ValidateResponseCode(494)); Assert.IsTrue(sut.ValidateResponseCode(495)); Assert.IsTrue(sut.ValidateResponseCode(496)); Assert.IsTrue(sut.ValidateResponseCode(497)); Assert.IsTrue(sut.ValidateResponseCode(499)); }
public void Construct_ValidCodesConstructor_ValidArray_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(new int[] { 21, 87, 180 }); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Custom, sut.ResponseType); Assert.AreEqual(3, sut.ValidCodes.Length); Assert.AreEqual(21, sut.ValidCodes[0]); Assert.AreEqual(87, sut.ValidCodes[1]); Assert.AreEqual(180, sut.ValidCodes[2]); Assert.IsTrue(sut.ValidateResponseCode(21)); Assert.IsTrue(sut.ValidateResponseCode(87)); Assert.IsTrue(sut.ValidateResponseCode(180)); Assert.IsFalse(sut.ValidateResponseCode(15)); }
public void ValidateResponseCode_Cloudflare_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); for (int i = 520; i < 528; i++) { Assert.IsTrue(sut.ValidateResponseCode(i)); } Assert.IsTrue(sut.ValidateResponseCode(530)); }
public void ValidateResponseCode_Nginx_ResponseTypeInformation_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Nginx); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Nginx, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(444)); Assert.IsTrue(sut.ValidateResponseCode(494)); Assert.IsTrue(sut.ValidateResponseCode(495)); Assert.IsTrue(sut.ValidateResponseCode(496)); Assert.IsTrue(sut.ValidateResponseCode(497)); Assert.IsTrue(sut.ValidateResponseCode(499)); Assert.IsFalse(sut.ValidateResponseCode(498)); }
public void ValidateResponseCode_Redirection_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(300)); Assert.IsTrue(sut.ValidateResponseCode(301)); Assert.IsTrue(sut.ValidateResponseCode(302)); Assert.IsTrue(sut.ValidateResponseCode(303)); Assert.IsTrue(sut.ValidateResponseCode(304)); Assert.IsTrue(sut.ValidateResponseCode(305)); Assert.IsTrue(sut.ValidateResponseCode(306)); Assert.IsTrue(sut.ValidateResponseCode(307)); Assert.IsTrue(sut.ValidateResponseCode(308)); }
public void ValidateResponseCode_Unnoficial_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(103)); Assert.IsTrue(sut.ValidateResponseCode(218)); Assert.IsTrue(sut.ValidateResponseCode(419)); Assert.IsTrue(sut.ValidateResponseCode(420)); Assert.IsTrue(sut.ValidateResponseCode(450)); Assert.IsTrue(sut.ValidateResponseCode(498)); Assert.IsTrue(sut.ValidateResponseCode(499)); Assert.IsTrue(sut.ValidateResponseCode(509)); Assert.IsTrue(sut.ValidateResponseCode(526)); Assert.IsTrue(sut.ValidateResponseCode(530)); Assert.IsTrue(sut.ValidateResponseCode(598)); }
public void ValidateResponseCode_ServerErrors_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(500)); Assert.IsTrue(sut.ValidateResponseCode(501)); Assert.IsTrue(sut.ValidateResponseCode(502)); Assert.IsTrue(sut.ValidateResponseCode(503)); Assert.IsTrue(sut.ValidateResponseCode(504)); Assert.IsTrue(sut.ValidateResponseCode(505)); Assert.IsTrue(sut.ValidateResponseCode(506)); Assert.IsTrue(sut.ValidateResponseCode(507)); Assert.IsTrue(sut.ValidateResponseCode(508)); Assert.IsTrue(sut.ValidateResponseCode(510)); Assert.IsTrue(sut.ValidateResponseCode(511)); }
public void ValidateResponseCode_ClientErrors_ResponseTypeClientAny_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Any); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Any, sut.ResponseType); for (int i = 400; i < 419; i++) { Assert.IsTrue(sut.ValidateResponseCode(i)); } Assert.IsTrue(sut.ValidateResponseCode(421)); Assert.IsTrue(sut.ValidateResponseCode(426)); Assert.IsTrue(sut.ValidateResponseCode(428)); Assert.IsTrue(sut.ValidateResponseCode(429)); Assert.IsTrue(sut.ValidateResponseCode(431)); Assert.IsTrue(sut.ValidateResponseCode(451)); }
public void ValidateResponseCode_Success_ResponseTypeInformation_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.Success); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.Success, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(200)); Assert.IsTrue(sut.ValidateResponseCode(201)); Assert.IsTrue(sut.ValidateResponseCode(202)); Assert.IsTrue(sut.ValidateResponseCode(203)); Assert.IsTrue(sut.ValidateResponseCode(204)); Assert.IsTrue(sut.ValidateResponseCode(205)); Assert.IsTrue(sut.ValidateResponseCode(206)); Assert.IsTrue(sut.ValidateResponseCode(207)); Assert.IsTrue(sut.ValidateResponseCode(208)); Assert.IsTrue(sut.ValidateResponseCode(226)); Assert.IsFalse(sut.ValidateResponseCode(209)); }
public void ValidateResponseCode_ServerErrors_ResponseTypeInformation_Success() { SettingHttpResponseAttribute sut = new SettingHttpResponseAttribute(HttpResponseType.ServerErrors); Assert.IsNotNull(sut); Assert.AreEqual(HttpResponseType.ServerErrors, sut.ResponseType); Assert.IsTrue(sut.ValidateResponseCode(500)); Assert.IsTrue(sut.ValidateResponseCode(501)); Assert.IsTrue(sut.ValidateResponseCode(502)); Assert.IsTrue(sut.ValidateResponseCode(503)); Assert.IsTrue(sut.ValidateResponseCode(504)); Assert.IsTrue(sut.ValidateResponseCode(505)); Assert.IsTrue(sut.ValidateResponseCode(506)); Assert.IsTrue(sut.ValidateResponseCode(507)); Assert.IsTrue(sut.ValidateResponseCode(508)); Assert.IsTrue(sut.ValidateResponseCode(510)); Assert.IsTrue(sut.ValidateResponseCode(511)); Assert.IsFalse(sut.ValidateResponseCode(509)); }