public void FormattingADisputeAsHal_WithAllLinkCallsInTheConfiguration_DoesntAskForMoreLinksThanItNeeds()
        {
            // Arrange
            const int disputeId = 12345;

            var mockedAddressResolver = new Mock <IAddressResolver>();

            var responseObject  = new DisputeResponse(mockedAddressResolver.Object);
            var expectedDispute = new DisputeModel {
                DisputeId = disputeId
            };

            var callsToGetLinkToCollection         = Times.Never();
            var callsToGetLink                     = Times.Exactly(2);
            var callsToGetLinkToEmbeddedCollection = Times.Never();
            var callsToGetLinkToEmbeddedItem       = Times.Never();
            var callsToGetLinkToSelf               = Times.Never();
            var callsToGetParent                   = Times.Never();
            var callsToGetPostLink                 = Times.Never();

            // Act
            responseObject.FormatForHal(expectedDispute);

            // Assert
            TestAssertions.ValidateCallsToAddLinksInHalConfiguration(
                mockedAddressResolver,
                callsToGetLinkToCollection,
                callsToGetLink,
                callsToGetLinkToEmbeddedCollection,
                callsToGetLinkToEmbeddedItem,
                callsToGetLinkToSelf,
                callsToGetParent,
                callsToGetPostLink);
        }
Ejemplo n.º 2
0
        public void VerifyTitle()
        {
            var pageHelper = new PageHelper();
            var assert     = new TestAssertions();

            if (Title.Displayed)
            {
                assert.VerifyText(Title.Text, TITLE);
            }
        }
Ejemplo n.º 3
0
        public void SignInToAccount(Customer customer)
        {
            Email.SendKeys(customer.Email);
            Password.SendKeys(customer.Password);
            SignInButton.Click();
            var assert = new TestAssertions();

            assert.VerifyPage(YourFeedTab);
            var user = new UserAccount(driver);

            user.VerifyUserName(customer);
        }
        public void CreateAnAccount(Customer customer)
        {
            var assert = new TestAssertions();

            assert.VerifyText(Title.Text.ToString(), PAGE_TITLE.ToString());

            UserName.SendKeys(customer.UserName);
            Email.SendKeys(customer.Email);
            Password.SendKeys(customer.Password);
            SignUpButton.Click();

            if (IsTextPersent(By.TagName("body"), EMAIL_EXISTS_ERROR_TEXT)) //This can be handled alot better. We could use a JS method to locate the error element.
            {
                SignInButton.Click();
                var signIn = new SignIn(driver);
                signIn.SignInToAccount(customer);
            }
        }