示例#1
0
        public void Test()
        {
            var problemStatement = new ProblemStatement
            {
                chores = new List <ChoreCore>
                {
                    createChore("c1", 1, 2, 3),
                    createChore("c2", 2, 2, 3),
                    createChore("c3", 1, 1, 1),
                    createChore("c4", 3, 2, 2),
                    createChore("c5", 1, 2, 1),
                    createChore("c6", 1, 2, 2),
                    createChore("c7", 2, 1, 2)
                },
                users = new List <UserCore>
                {
                    new UserCore
                    {
                        userId = "u1",
                        shareOfChoresPercent = 0.33333
                    },
                    new UserCore
                    {
                        userId = "u2",
                        shareOfChoresPercent = 0.111111
                    },
                    new UserCore
                    {
                        userId = "u3",
                        shareOfChoresPercent = 0.666666
                    },
                }
            };

            var assService = new AssignmentService();
            var result1    = assService.GetBuckets(problemStatement.users, problemStatement.chores);

            Assert.Equal(3, result1.Count());
        }