コード例 #1
0
        public void 使用UserName和CreateTime作為群組依據Test()
        {
            var expected =
                new List <string>()
            {
                { "demo2016-01-20" },
                { "demo2016-02-20" },
                { "demo2016-03-20" },
                { "demo2016-03-20" },
                { "joey2016-04-20" },
                { "joey2016-05-20" },
                { "joey2016-06-20" },
                { "dino2016-07-20" },
                { "bill2016-08-20" },
                { "maduka2016-01-20" },
            }.ToExpectedObject();

            var actual = new GroupByLab().使用UserName和CreateTime作為群組依據();

            expected.ShouldEqual(actual.Select(d => d.Key.UserName + "" + d.Key.CreateTime.ToString("yyyy-MM-dd")).ToList());
        }
コード例 #2
0
        public void GroupByUserNameAndCreateTimeTest()
        {
            var expected =
                new List <string>()
            {
                { "Zoe2016-01-20" },
                { "Demo2016-02-20" },
                { "Demo2016-03-20" },
                { "Demo2016-03-20" },
                { "Zoe2016-04-20" },
                { "Zoe2016-05-20" },
                { "Zoe2016-06-20" },
                { "Stephen2016-07-20" },
                { "Bill2016-08-20" },
                { "Kyo2016-01-20" },
            }.ToExpectedObject();

            var actual = new GroupByLab().GroupByUserNameAndCreateTime();

            expected.ShouldEqual(actual.Select(d => d.Key.UserName + "" + d.Key.CreateTime.ToString("yyyy-MM-dd")).ToList());
        }