示例#1
0
        public void Edit(string currencyCode, [FromBody] Frapid.Config.Entities.Currency currency)
        {
            if (currency == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed));
            }

            try
            {
                this.CurrencyRepository.Update(currency, currencyCode);
            }
            catch (UnauthorizedException)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Forbidden));
            }
            catch (DataAccessException ex)
            {
                throw new HttpResponseException(new HttpResponseMessage
                {
                    Content    = new StringContent(ex.Message),
                    StatusCode = HttpStatusCode.InternalServerError
                });
            }
#if !DEBUG
            catch
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
#endif
        }
示例#2
0
 public void Last()
 {
     Frapid.Config.Entities.Currency currency = Fixture().GetLast();
     Assert.NotNull(currency);
 }
示例#3
0
 public void Next()
 {
     Frapid.Config.Entities.Currency currency = Fixture().GetNext(string.Empty);
     Assert.NotNull(currency);
 }