public static bool ValidarQuantidadeEhValido(this Alerta alerta, int quantidade)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertGreaterThanZero(quantidade, "A quantidade precisa ser maior que zero!")
            ));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// validate basic order parameters
 /// </summary>
 private static void ValidateBasicOrderParameters(Security security, string orderSide, int orderSize, string orderExecutionProvider)
 {
     AssertionConcern.AssertArgumentNotNull(security, "Security cannot be null");
     AssertionConcern.AssertNullOrEmptyString(orderSide, "Order Side cannot be null or empty");
     AssertionConcern.AssertGreaterThanZero(orderSize, "Order Size must be greater than 0");
     AssertionConcern.AssertNullOrEmptyString(orderExecutionProvider, "Order Execution Provider cannot be null or empty");
 }
Ejemplo n.º 3
0
 public static bool ValidarComprimentoHasteEhValido(this Produto produto, int comprimento)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertGreaterThanZero(comprimento, "O comprimento da haste é obrigatório!")
            ));
 }
Ejemplo n.º 4
0
 public static bool ValidarTamanhoPonteEhValido(this Produto produto, int tamanhoPonte)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertGreaterThanZero(tamanhoPonte, "O tamanho da ponte é obrigatório!")
            ));
 }
Ejemplo n.º 5
0
 public static bool ValidarCurvaturaEhValido(this Produto produto, int comprimento)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertGreaterThanZero(comprimento, "A curvatura é obrigatório!")
            ));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Factory Constructor for limit order
 /// </summary>
 /// <param name="orderId"> </param>
 /// <param name="pair"></param>
 /// <param name="price"></param>
 /// <param name="orderSide"></param>
 /// <param name="orderType"></param>
 /// <param name="volume"></param>
 /// <param name="traderId"></param>
 public Order(OrderId orderId, string pair, Price price, OrderSide orderSide, OrderType orderType, Volume volume,
              TraderId traderId)
 {
     OrderId      = orderId;
     CurrencyPair = pair;
     if (orderType == OrderType.Limit)
     {
         AssertionConcern.AssertGreaterThanZero(price.Value, "Limit order price must be greater than 0");
     }
     Price          = price;
     OrderSide      = orderSide;
     OrderType      = orderType;
     Volume         = volume;
     TraderId       = traderId;
     this.DateTime  = DateTime.Now;
     FilledQuantity = new Volume(0);
     _filledCost    = new Price(0);
     OpenQuantity   = Volume;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Change quantity for an order
 /// </summary>
 public void ChangeQuantity(Order order, Volume newVolume)
 {
     AssertionConcern.AssertGreaterThanZero(newVolume.Value, "New volume for the order is less than zero");
     order.UpdateVolume(newVolume);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// validate limit order price
 /// </summary>
 private static void ValidateLimitOrderPrice(decimal limitPrice)
 {
     AssertionConcern.AssertGreaterThanZero(limitPrice, "Limit Price should be greater than 0");
 }
Ejemplo n.º 9
0
        public void Assertion_ValidarGreaterThanZero_False()
        {
            var validacaoChavesDiferentes = AssertionConcern.AssertGreaterThanZero(-1, "memsagem");

            Assert.False(AssertionConcern.IsSatisfiedBy(validacaoChavesDiferentes));
        }
Ejemplo n.º 10
0
        public void Assertion_ValidarGreaterThanZero_True()
        {
            var validacao = AssertionConcern.AssertGreaterThanZero(1, "memsagem");

            Assert.True(AssertionConcern.IsSatisfiedBy(validacao));
        }