Esempio n. 1
0
        private async Task <bool> ValidateOrderForm(OrderForm orderForm)
        {
            var isValid = false;

            if (EntryOrderValidator.CheckFormDataCompleteness(orderForm))
            {
                if (EntryOrderValidator.CheckFormDataSemantic(orderForm))
                {
                    var wallet = await new ApiCaller().GetWalletByUserId(orderForm.UserId);

                    if (wallet is null)
                    {
                        return(false);
                    }

                    if (EntryOrderValidator.ValidateWallet(orderForm, wallet))
                    {
                        isValid = true;
                    }
                }
            }
            return(isValid);
        }
Esempio n. 2
0
        public void CheckFormDataSemantic_Incorect_Failed(OrderForm form)
        {
            var result = EntryOrderValidator.CheckFormDataSemantic(form);

            Assert.IsFalse(result, $"Incorect form was accepted : {form.Ticker}");
        }
Esempio n. 3
0
        public void CheckFormDataSemantic_Correct_Succes(OrderForm form)
        {
            var result = EntryOrderValidator.CheckFormDataSemantic(form);

            Assert.IsTrue(result, $"correct form was rejected : {form.Ticker}");
        }