Esempio n. 1
0
        private void TestCommunityNewOrder(string contactProductName, CreditCardType creditCardType, bool useDiscount)
        {
            var products  = GetProducts(contactProductName);
            var data      = TestCommunity.Vecci.GetCommunityTestData();
            var community = data.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);

            var price                 = (from p in products select p.Price).Sum();
            var adjustments           = GetAdjustments(products, price, creditCardType);
            var discountedAdjustments = GetDiscountedAdjustments(price, creditCardType);

            var employer = LogIn(false);

            // Hit the landing page.

            var url = _verticalsCommand.GetCommunityPathUrl(community, "employers/Employer.aspx");

            Get(url);

            // Choose.

            var instanceId = Choose(contactProductName);

            AssertPaymentPage(instanceId, products, adjustments, true);

            // Pay.

            Pay(instanceId, null, creditCardType, true, useDiscount);
            AssertReceiptPage(instanceId, products, useDiscount ? discountedAdjustments : adjustments);
            AssertOrdersPage(useDiscount ? discountedAdjustments : adjustments);
            AssertEmail(products, useDiscount ? discountedAdjustments : adjustments);

            AssertOrder(employer.Id, useDiscount ? discountedAdjustments : adjustments);
        }
Esempio n. 2
0
 protected ReadOnlyUrl GetCommunityPathUrl(Community community, bool secure, string path)
 {
     return(_verticalsCommand.GetCommunityPathUrl(community, secure, path));
 }
Esempio n. 3
0
        private void TestJoinWithNewOrder(TestCommunity testCommunity, bool shouldBeJoined)
        {
            var data      = testCommunity.GetCommunityTestData();
            var community = data.CreateTestCommunity(_communitiesCommand, _verticalsCommand, _contentEngine);

            // Hit the landing page.

            var url = _verticalsCommand.GetCommunityPathUrl(community, "employers/Employer.aspx");

            Get(url);

            // Choose.

            var host      = Browser.CurrentUrl.Host;
            var chooseUrl = GetChooseUrl().AsNonReadOnly();

            chooseUrl.Host = host;
            Get(chooseUrl);

            SelectContactProduct(_productsQuery.GetProduct("Contacts40"));
            _purchaseButton.Click();
            var instanceId = GetInstanceId();

            // Join.

            var accountUrl = GetAccountUrl(instanceId).AsNonReadOnly();

            accountUrl.Host = host;
            AssertUrl(accountUrl);

            _joinLoginIdTextBox.Text         = LoginId;
            _joinPasswordTextBox.Text        = Password;
            _joinConfirmPasswordTextBox.Text = Password;
            _firstNameTextBox.Text           = FirstName;
            _lastNameTextBox.Text            = LastName;
            _emailAddressTextBox.Text        = EmailAddress;
            _phoneNumberTextBox.Text         = PhoneNumber;
            _organisationNameTextBox.Text    = OrganisationName;
            _locationTextBox.Text            = Location;
            _acceptTermsCheckBox.IsChecked   = true;
            _joinButton.Click();

            // Payment.

            var paymentUrl = GetPaymentUrl(instanceId).AsNonReadOnly();

            paymentUrl.Host = host;
            AssertUrl(paymentUrl);

            _cardNumberTextBox.Text                = CreditCardNumber;
            _cvvTextBox.Text                       = Cvv;
            _cardHolderNameTextBox.Text            = CardHolderName;
            _authoriseCreditCardCheckBox.IsChecked = true;
            _purchaseButton.Click();

            // Receipt.

            var receiptUrl = GetReceiptUrl(instanceId).AsNonReadOnly();

            receiptUrl.Host = host;
            AssertUrl(receiptUrl);

            AssertCommunity(community, LoginId, shouldBeJoined);
        }