Ejemplo n.º 1
0
        public void FindRefereeByUsernameAndPasswordTest()
        {
            IDictionary <string, string> props = new SortedList <string, string>();

            props.Add("ConnectionString", "server=localhost;user=root;database=mpp;port=3306;password=root");
            RefereeRepository repository = new RefereeRepository(props);
            Referee           referee    = repository.FindRefereeByUsernameAndPassword("john", "1234");

            Assert.AreEqual(referee.FirstName, "John");
        }
Ejemplo n.º 2
0
        public Referee Authenticate(string username, string password)
        {
            Referee referee = refereeRepository.FindRefereeByUsernameAndPassword(username, password);
            Race    race    = raceRepository.FindRaceByReferee(username);

            if (referee == null || race == null)
            {
                return(null);
            }
            race.Referee = referee;
            referee.Race = race;
            return(referee);
        }