Esempio n. 1
0
        public void ThenIAmNotAllowedToExecuteBrandMethodsUsingGET()
        {
            const HttpStatusCode statusCode = HttpStatusCode.MethodNotAllowed;

            Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <AddBrandResponse>(AdminApiRoutes.AddBrand, string.Empty)).StatusCode, Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <EditBrandResponse>(AdminApiRoutes.EditBrand, string.Empty)).StatusCode, Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <ActivateBrandResponse>(AdminApiRoutes.ActivateBrand, string.Empty)).StatusCode, Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <DeactivateBrandResponse>(AdminApiRoutes.DeactivateBrand, string.Empty)).StatusCode, Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <AssignBrandCountryResponse>(AdminApiRoutes.AssignBrandCountry, string.Empty)).StatusCode, Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <AssignBrandCultureRequest>(AdminApiRoutes.AssignBrandCulture, string.Empty)).StatusCode, Is.EqualTo(statusCode));
            Assert.That(Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <AssignBrandCurrencyRequest>(AdminApiRoutes.AssignBrandCurrency, string.Empty)).StatusCode, Is.EqualTo(statusCode));
        }
Esempio n. 2
0
 public void ThenIAmNotAllowedToExecuteBonusMethodsUsingGET()
 {
     Assert.AreEqual(HttpStatusCode.MethodNotAllowed, Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <ToggleBonusStatusResponse>(AdminApiRoutes.ChangeBonusStatus, string.Empty)).StatusCode);
     Assert.AreEqual(HttpStatusCode.MethodNotAllowed, Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <AddEditBonusResponse>(AdminApiRoutes.CreateUpdateBonus, string.Empty)).StatusCode);
     Assert.AreEqual(HttpStatusCode.MethodNotAllowed, Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <DeleteTemplateResponse>(AdminApiRoutes.DeleteBonusTemplate, string.Empty)).StatusCode);
     Assert.AreEqual(HttpStatusCode.MethodNotAllowed, Assert.Throws <AdminApiProxyException>(() => AdminApiProxy.CommonGet <AddEditTemplateResponse>(AdminApiRoutes.CreateEditBonusTemplate, string.Empty)).StatusCode);
 }