public void UnauthorizedIncorrectLoginOrPasswordThrowsException() { object Action() => _clientIncorrectLoginOrPassword.CreatePayment(_newPayment); YandexCheckoutException ex = Assert.ThrowsException <YandexCheckoutException>(Action); Assert.AreEqual(HttpStatusCode.Unauthorized, ex.StatusCode); Assert.AreEqual("Error in shopId or secret key. Check their validity. You can reissue the key in the Merchant Profile", ex.Message); }
public void UnauthorizedInvalidKeyFormatThrowsException() { object Action() => _clientInvalidLoginFormat.CreatePayment(_newPayment); YandexCheckoutException ex = Assert.ThrowsException <YandexCheckoutException>(Action); Assert.AreEqual(HttpStatusCode.Unauthorized, ex.StatusCode); Assert.AreEqual("Login has illegal format", ex.Message); }
public void UnauthorizedInvalidPasswordFormatThrowsException() { object Action() => _clientInvalidPasswordFormat.CreatePayment(_newPayment); YandexCheckoutException ex = Assert.ThrowsException <YandexCheckoutException>(Action); Assert.AreEqual(HttpStatusCode.Unauthorized, ex.StatusCode); Assert.AreEqual("Incorrect password format in the Authorization header. Use Secret key issued in Merchant Profile as the password", ex.Message); }
public async Task UnauthorizedIncorrectLoginOrPasswordThrowsException() { var asyncClient = _clientIncorrectLoginOrPassword.MakeAsync(); async Task Action() => await asyncClient.CreatePaymentAsync(_newPayment); YandexCheckoutException ex = await Assert.ThrowsExceptionAsync <YandexCheckoutException>(Action); Assert.AreEqual(HttpStatusCode.Unauthorized, ex.StatusCode); Assert.AreEqual("Error in shopId or secret key. Check their validity. You can reissue the key in the Merchant Profile", ex.Message); }
public async Task UnauthorizedInvalidKeyFormatThrowsException() { var asyncClient = _clientInvalidLoginFormat.MakeAsync(); async Task Action() => await asyncClient.CreatePaymentAsync(_newPayment); YandexCheckoutException ex = await Assert.ThrowsExceptionAsync <YandexCheckoutException>(Action); Assert.AreEqual(HttpStatusCode.Unauthorized, ex.StatusCode); Assert.AreEqual("Login has illegal format", ex.Message); }
public async Task UnauthorizedInvalidPasswordFormatThrowsException() { var asyncClient = _clientInvalidPasswordFormat.MakeAsync(); async Task Action() => await asyncClient.CreatePaymentAsync(_newPayment); YandexCheckoutException ex = await Assert.ThrowsExceptionAsync <YandexCheckoutException>(Action); Assert.AreEqual(HttpStatusCode.Unauthorized, ex.StatusCode); Assert.AreEqual("Incorrect password format in the Authorization header. Use Secret key issued in Merchant Profile as the password", ex.Message); }