public void TestCustomsDeclarationGroup()
        {
            CustomsDeclarationGroup group = new CustomsDeclarationGroup();

            group.AddPerson("abcx");
            group.AddPerson("abcy");
            group.AddPerson("abcz");
            Assert.Equal(6, group.Count());
        }
        public void TestCustomsDeclarationGroupEveryone()
        {
            CustomsDeclarationGroup group = new CustomsDeclarationGroup();

            group.AddPerson("abcx");
            group.AddPerson("abcy");
            group.AddPerson("abcz");
            Assert.Equal(3, group.CountWhereEveryone());
        }
示例#3
0
        public static List <CustomsDeclarationGroup> ParseDeclarations(List <string> declarations)
        {
            List <CustomsDeclarationGroup> groups = new List <CustomsDeclarationGroup>();
            CustomsDeclarationGroup        group  = new CustomsDeclarationGroup();

            foreach (string line in declarations)
            {
                if (line == "")
                {
                    groups.Add(group);
                    group = new CustomsDeclarationGroup();
                }
                else
                {
                    group.AddPerson(line);
                }
            }
            groups.Add(group);
            return(groups);
        }