public void Registering_a_new_customer_with_valid_data_should_return_a_valid_view_model() { _vm.WantsPremiumSupport = false; var result = _sut.RegisterCustomer(_vm); result.Success.Should().BeTrue(); }
public IHttpActionResult Register([FromBody] RegisterRequest register) { try { if (ModelState.IsValid) { return(Ok(CustomerRegistration.RegisterCustomer(register))); } else { return(Ok(CustomerRegistration.GetPaymentMethodOptions())); } } catch (Exception ex) { return(Ok("unable to complete registration")); } }
protected void btnsignup_Click(object sender, EventArgs e) { string FN = txtUFname.Text; string LN = txtULname.Text; DateTime DOB; try { DOB = DateTime.Parse(txtudob.Text); } catch (Exception ex) { DOB = DateTime.ParseExact(txtudob.Text, "dd-MM-yyyy", null); } int age = Int32.Parse(txUge.Text.Substring(0, txUge.Text.IndexOf(" "))); string G = ""; if (urb1.Checked == true) { G = urb1.Text; } if (urb2.Checked == true) { G = urb2.Text; } string contact = ucontact.Text; string admId = txtUId.Text; string admPsw = txtupw.Text; string confPsw = txtuconfirm.Text; string status = CustomerRegistration.RegisterCustomer(FN, LN, DOB, age, G, contact, admId, admPsw, confPsw); lbStatus.Text = status; if (status.Equals("Customer Details Registered Successfully!")) { Response.Redirect("firstpage.aspx"); } }