Ejemplo n.º 1
0
        public async Task IsValidateModuleName()
        {
            try
            {
                PaymentOptions paymentOptions = new PaymentOptions {
                    Name = " "
                };
                var controller = new PaymentOptionsController();
                var result     = await controller.PostPaymentOptions(paymentOptions);

                Assert.Equal(result.Value.ToString(), "Name is empty");
            }
            catch (Exception ex)
            {
                Assert.NotNull(ex);
                // Assert.IsType<InvalidOperationException>(ex);
            }
        }
Ejemplo n.º 2
0
        public async Task InsertModuleTest()
        {
            try
            {
                var            controller     = new PaymentOptionsController();
                PaymentOptions paymentOptions = new PaymentOptions {
                    Name = "Debit Card"
                };
                var result = await controller.PostPaymentOptions(paymentOptions);

                Assert.Equal(result.Value.ToString(), "DataSved Successfully");
                Assert.Equal(result.Value.ToString(), "already Existed");
            }
            catch (Exception ex)
            {
                Assert.NotNull(ex);
            }
        }