예제 #1
0
    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"));
    }
예제 #2
0
    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"));
    }
예제 #3
0
    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"));
    }
예제 #4
0
    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"));
    }
예제 #5
0
    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"));
    }
예제 #6
0
    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"));
    }
예제 #7
0
    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"));
    }
예제 #8
0
    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"));
    }