public void ThenIAmNotAllowedToExecuteBrandMethodsUsingPOST() { const HttpStatusCode statusCode = HttpStatusCode.MethodNotAllowed; Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <object, UserBrandsResponse>(AdminApiRoutes.GetUserBrands, new object())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <object, BrandAddDataResponse>(AdminApiRoutes.GetBrandAddData, new object())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, BrandEditDataResponse>(AdminApiRoutes.GetBrandEditData + "?id=", new Guid())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, BrandEditDataResponse>(AdminApiRoutes.GetBrandViewData + "?id=", new Guid())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, BrandCountriesResponse>(AdminApiRoutes.GetBrandCountries + "?brandId=", new Guid())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <object, BrandsResponse>(AdminApiRoutes.GetBrands + "?useFilter=&licensees=", new object())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, BrandCountryAssignDataResponse>(AdminApiRoutes.GetBrandCountryAssignData + "?brandId=", new Guid())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, BrandCultureAssignDataResponse>(AdminApiRoutes.GetBrandCultureAssignData + "?brandId=", new Guid())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, BrandCurrencyAssignDataResponse>(AdminApiRoutes.GetBrandCurrencyAssignData + "?brandId=", new Guid())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, GetBrandCurrenciesResponse>(AdminApiRoutes.GetBrandCurrencies + "?brandId=", new Guid())).StatusCode, Is.EqualTo(statusCode)); Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <Guid, GetBrandCurrenciesWithNamesResponse>(AdminApiRoutes.GetBrandCurrenciesWithNames + "?brandId=", new Guid())).StatusCode, Is.EqualTo(statusCode)); }
public void ThenIAmNotAllowedToExecuteBonusMethodsUsingPOST() { Assert.AreEqual(HttpStatusCode.MethodNotAllowed, Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <object, BonusDataResponse>(AdminApiRoutes.GetBonusRelatedData + "?id=", new Guid())).StatusCode); Assert.AreEqual(HttpStatusCode.MethodNotAllowed, Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonPost <object, TemplateDataResponse>(AdminApiRoutes.GetBonusTemplateRelatedData + "?id=", new Guid())).StatusCode); }