private static void AssertSurvival(IWebDriver driver, Gender gender, int birthYear, int weeklyPlaytime, PlayStyle playStyle, bool expectSurvival)
        {
            SignInHelper.SignInWithId(driver, UserConstants.SampleSteamId);
            SurvivalHelper.CalculateSurvival(driver, gender, birthYear, weeklyPlaytime, playStyle);

            Console.WriteLine("Parsing backlog completion date...");
            var backlogCompletion = TestUtil.ParseBrowserDate(driver, driver.FindElement(By.Id(SiteConstants.SurvivalBacklogCompletionLabelId)).Text);

            Console.WriteLine("Parsing time of death date...");
            var timeOfDeath = TestUtil.ParseBrowserDate(driver, driver.FindElement(By.Id(SiteConstants.SurvivalTimeOfDeathLabelId)).Text);

            Console.WriteLine("Asserting expected results...");
            bool survival = timeOfDeath >= backlogCompletion;

            if (expectSurvival)
            {
                Assert.IsTrue(survival, "Expected time of death to come after backlog completion");
                Assert.IsTrue(driver.FindElement(By.Id(SiteConstants.SurvivalSuccessImgId)).Displayed, "Expected backlog completion success");
            }
            else
            {
                Assert.IsFalse(survival, "Expected time of death to come before backlog completion");
                Assert.IsTrue(driver.FindElement(By.Id(SiteConstants.SurvivalFailureImgId)).Displayed, "Expected backlog completion failure");
            }
        }
        private static void AssertNoShareLinks(IWebDriver driver)
        {
            Assert.IsFalse(driver.FindElement(By.Id(SiteConstants.SocialSharingHeaderId)).Displayed,
                           "Expected hidden social sharing section in non-user games page");

            SurvivalHelper.CalculateSurvival(driver, Gender.Female, DateTime.Now.Year - 20, 10, PlayStyle.Extras);

            Assert.IsFalse(driver.FindElement(By.Id(SiteConstants.SurvivalSocialSharingHeaderId)).Displayed,
                           "Expected hidden survival social sharing section in non-user games page");
        }
        public void TestShareLinks()
        {
            SeleniumExtensions.ExecuteOnMultipleBrowsers(driver =>
            {
                var isInternetExplorer = driver is InternetExplorerDriver;

                SignInHelper.SignInWithId(driver);

                LinkHelper.AssertExternalLink(driver, SiteConstants.FacebookShareAnchorId, FacebookShareTitle, newWindow: true, dismissAlertOnClose: isInternetExplorer);
                LinkHelper.AssertExternalLink(driver, SiteConstants.TwitterShareAnchorId, TwitterShareTitle, newWindow: true);
                LinkHelper.AssertExternalLink(driver, SiteConstants.RedditShareAnchorId, RedditShareTitle, newWindow: true);

                SurvivalHelper.CalculateSurvival(driver, Gender.Female, DateTime.Now.Year - 20, 10, PlayStyle.Extras);

                LinkHelper.AssertExternalLink(driver, SiteConstants.SurvivalFacebookShareAnchorId, FacebookShareTitle, newWindow: true, dismissAlertOnClose: isInternetExplorer);
                LinkHelper.AssertExternalLink(driver, SiteConstants.SurvivalTwitterShareAnchorId, TwitterShareTitle, newWindow: true);
                LinkHelper.AssertExternalLink(driver, SiteConstants.SurvivalRedditShareAnchorId, RedditShareTitle, newWindow: true);
            });
        }