public void TestAuthenticate()
        {
            var logger = new ConsoleLogger();
            var authenticator = new FantasyPremierLeagueAuthenticator(logger);

            var cookies = authenticator.Authenticate(TestConstants.USERNAME, TestConstants.PASSWORD);

            Assert.IsNotNull(cookies);
            Assert.IsTrue(cookies.Count > 0);
        }
コード例 #2
0
        public void TestAuthenticate()
        {
            var logger        = new ConsoleLogger();
            var authenticator = new FantasyPremierLeagueAuthenticator(logger);

            var cookies = authenticator.Authenticate(TestConstants.USERNAME, TestConstants.PASSWORD);

            Assert.IsNotNull(cookies);
            Assert.IsTrue(cookies.Count > 0);
        }
コード例 #3
0
        private void CheckAndCreateSession()
        {
            if (_session == null)
            {
                _logger.WriteInfoMessage("Creating Session");
                var authenticator = new FantasyPremierLeagueAuthenticator(_logger);
                _session = authenticator.Authenticate(_username, _password);

                if (_session == null)
                    throw new ApplicationException("Failed to create session");
            }
        }