using System.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TechTalk.SpecFlow;
using Calculator.AcceptanceTests.StepHelpers;

namespace Calculator.AcceptanceTests.SharedSteps
{
    [Binding]
    public class SiteNavigation
    {
        [Given(@"the application is loaded")]
        public void TheApplicationIsLoaded()
        {
            WebBrowser.Current.GoTo(ConfigurationManager.AppSettings["LocalDebug"]);
        }

        [When("the user is on the \"(.*)\" page")]
        public void TheUserIsOnThePage(string pageName)
        {
            // Arrange

            // Act
            string title = WebBrowser.Current.Title;

            // Assert
            Assert.AreEqual(pageName, title, string.Format("Page title was {0}, but expected to be {1}", title, pageName));
        }
    }
}
