Example #1
0
        static void Main(string[] args)
        {
            var emailMatchAlerter = new EmailMatchAlerter();
            var dynamoDbMatchLogger = new DynamoDbMatchLogger();
            var matchArranger = new MatchArranger(dynamoDbMatchLogger, emailMatchAlerter);
            matchArranger.ArrangeRandomActsOfCoffee(2);

            Console.ReadLine();
        }
        public void MakeMatches(int employeesToSupply, int matchesToMake, int matchesMade)
        {
            var employees = new List<Employee>();
            for (int i = 0; i < employeesToSupply; i++)
                employees.Add(GetRandomEmployee());

            var matchArranger = new MatchArranger(GetStubbedMatchLogger(), GetStubbedMatchAlerter());
            var matches = matchArranger.MakeMatches(employees, matchesToMake);

            Assert.AreEqual(matchesMade, matches.Count());
        }
        public void DoNotMatchEmployeesFromDifferentStates(int matchesToMake
            ,int matchesMade
            ,int employeesFromNewYork
            ,int employeesFromCalifornia)
        {
            var employees = new List<Employee>();

            for (int i = 0; i < employeesFromNewYork; i++)
                employees.Add(GetRandomEmployee("NY"));

            for (int i = 0; i < employeesFromCalifornia; i++)
                employees.Add(GetRandomEmployee("CA"));

            var matchArranger = new MatchArranger(GetStubbedMatchLogger(), GetStubbedMatchAlerter());
            var matches = matchArranger.MakeMatches(employees, matchesToMake);

            Assert.AreEqual(matchesMade, matches.Count());
        }