public static bool ValidarQuantidadeEhValido(this Alerta alerta, int quantidade) { return(AssertionConcern.IsSatisfiedBy ( AssertionConcern.AssertGreaterThanZero(quantidade, "A quantidade precisa ser maior que zero!") )); }
/// <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"); }
public static bool ValidarComprimentoHasteEhValido(this Produto produto, int comprimento) { return(AssertionConcern.IsSatisfiedBy ( AssertionConcern.AssertGreaterThanZero(comprimento, "O comprimento da haste é obrigatório!") )); }
public static bool ValidarTamanhoPonteEhValido(this Produto produto, int tamanhoPonte) { return(AssertionConcern.IsSatisfiedBy ( AssertionConcern.AssertGreaterThanZero(tamanhoPonte, "O tamanho da ponte é obrigatório!") )); }
public static bool ValidarCurvaturaEhValido(this Produto produto, int comprimento) { return(AssertionConcern.IsSatisfiedBy ( AssertionConcern.AssertGreaterThanZero(comprimento, "A curvatura é obrigatório!") )); }
/// <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; }
/// <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); }
/// <summary> /// validate limit order price /// </summary> private static void ValidateLimitOrderPrice(decimal limitPrice) { AssertionConcern.AssertGreaterThanZero(limitPrice, "Limit Price should be greater than 0"); }
public void Assertion_ValidarGreaterThanZero_False() { var validacaoChavesDiferentes = AssertionConcern.AssertGreaterThanZero(-1, "memsagem"); Assert.False(AssertionConcern.IsSatisfiedBy(validacaoChavesDiferentes)); }
public void Assertion_ValidarGreaterThanZero_True() { var validacao = AssertionConcern.AssertGreaterThanZero(1, "memsagem"); Assert.True(AssertionConcern.IsSatisfiedBy(validacao)); }