public void ValidateUniqueEmailCheckInDatabase() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "*****@*****.**"; request.FirstName = "simple"; request.LastName = "simple"; request.Phone = "12345678901"; request.Sandbox_Key = "123"; Enrollees enrollee = new Enrollees(); if (enrollee.get_enrollees($" where email = '{request.Email}'").Count == 0) { Enrollees_Table enrolleesData = new Enrollees_Table(); // please either try to check this email for every test or delete it's record from the database enrolleesData.Email = "*****@*****.**"; enrolleesData.First_name = "simple"; enrolleesData.Last_name = "simple"; enrolleesData.Phone = "12345678901"; enrollee.add_enrollees(enrolleesData); } ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Response == "Failed" && response.Message == "Enrollee data already exists" ? "true":"false")); }
public void FirstNameBewteen_1_AndTwentyCharacter() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "*****@*****.**"; request.FirstName = "simple"; request.LastName = ""; request.Phone = ""; request.Sandbox_Key = ""; ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Message != "Invalid first name" ? "true":"false")); }
public void FirstNameGreaterThanTwentyCharacter() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "*****@*****.**"; request.FirstName = "abcdefghijklmnopqrstuvwxyz"; request.LastName = ""; request.Phone = ""; request.Sandbox_Key = ""; ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Response == "Failed" && response.Message == "Invalid first name" ? "true":"false")); }
public void SubmitPost() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "*****@*****.**"; request.FirstName = "simple"; request.LastName = "simple"; request.Phone = "12345678901"; request.Sandbox_Key = "2"; ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Response == "Successful" && response.Message == "Enrollee data captured successfully" ? "true":"false")); }
public void SandboxKeyEntered() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "*****@*****.**"; request.FirstName = "simple"; request.LastName = "simple"; request.Phone = "12345678901"; request.Sandbox_Key = "123"; ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Message != "Invalid sandbox key" ? "true":"false")); }
public void PhoneBewteenIsElevenCharacter() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "*****@*****.**"; request.FirstName = "simple"; request.LastName = "simple"; request.Phone = "12345678901"; request.Sandbox_Key = ""; ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Message != "Invalid phone number" ? "true":"false")); }
public void EmailLessThanFiveCharacter() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "abc"; request.FirstName = ""; request.LastName = ""; request.Phone = ""; request.Sandbox_Key = ""; ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Response == "Failed" && response.Message == "Invalid email address" ? "true":"false")); }
public void LastNameLessThanOneCharacter() { SignUpController signUp = new SignUpController(); RequestMessage request = new RequestMessage(); request.Email = "*****@*****.**"; request.FirstName = "simple"; request.LastName = ""; request.Phone = ""; request.Sandbox_Key = ""; ResponsMessage response = signUp.NewPlanSubscription(request); Assert.Equal("true", (response.Response == "Failed" && response.Message == "Invalid last name" ? "true":"false")); }