@@ -343,58 +343,57 @@ public void Max_With_Predicate_Should_Return_Max(IRepository<Contact, string> re
343343
344344 repository . Max ( x => x . ContactTypeId < 3 , x => x . ContactTypeId ) . ShouldBe ( 2 ) ;
345345 }
346-
347- //
348- // [ExecuteForAllRepositoriesExcept(RepositoryType.CouchDb, RepositoryType.MongoDb, RepositoryType.RavenDb, Reason = "GroupBy Not Supported")]
349- // public void GroupMin_Should_Return_Proper_Counts(IRepository<Contact, string> repository)
350- // {
351- // for (var i = 1; i <= 3; i++)
352- // {
353- // var contact = new Contact { Name = "Test User " + i, ContactTypeId =1, SumDecimal = 0.5m + i};
354- // repository.Add(contact);
355- // }
356- // for (var i = 4; i <= 7; i++)
357- // {
358- // var contact = new Contact { Name = "Test User " + i, ContactTypeId = 2, SumDecimal = 0.5m + i};
359- // repository.Add(contact);
360- // }
361- //
362- // var groups = repository.GroupMin(x =>x.ContactTypeId, x => x.SumDecimal);
363- //
364- // groups.Count().ShouldBe(2);
365- //
366- //
367- // groups[1].ShouldBe(1.5m);
368- // groups[2].ShouldBe(4.5m);
369- // }
370- //
371- // [ExecuteForAllRepositoriesExcept(RepositoryType.CouchDb, RepositoryType.MongoDb, RepositoryType.RavenDb, Reason = "GroupBy Not Supported")]
372- // public void GroupMax_Should_Return_Proper_Counts(IRepository<Contact, string> repository)
373- // {
374- // for (var i = 1; i <= 3; i++)
375- // {
376- // var contact = new Contact { Name = "Test User " + i, ContactTypeId =1, SumDecimal = 0.5m + i};
377- // repository.Add(contact);
378- // }
379- // for (var i = 4; i <= 7; i++)
380- // {
381- // var contact = new Contact { Name = "Test User " + i, ContactTypeId = 2, SumDecimal = 0.5m + i};
382- // repository.Add(contact);
383- // }
384- //
385- // var groups = repository.GroupBy(x => x.ContactTypeId,
386- // x => new {Key = x.Key, Max = x.Max(o => o.SumDecimal)});
387- //
388- // //var groups = repository.GroupMax(x =>x.ContactTypeId, x => x.SumDecimal);
389- //
390- // groups.Count().ShouldBe(2);
391- // groups.First().Key.ShouldBe(1);
392- // groups.First().Max.ShouldBe(3.5m);
393- // groups.Last().Key.ShouldBe(2);
394- // groups.Last().Max.ShouldBe(7.5m);
395- //// groups[1].ShouldBe(3.5m);
396- //// groups[2].ShouldBe(7.5m);
397- // }
346+
347+ //[ExecuteForAllRepositoriesExcept(RepositoryType.CouchDb, RepositoryType.MongoDb, RepositoryType.RavenDb, Reason = "GroupBy Not Supported")]
348+ //public void GroupMin_Should_Return_Proper_Counts(IRepository<Contact, string> repository)
349+ //{
350+ // for (var i = 1; i <= 3; i++)
351+ // {
352+ // var contact = new Contact { Name = "Test User " + i, ContactTypeId = 1, SumDecimal = 0.5m + i };
353+ // repository.Add(contact);
354+ // }
355+ // for (var i = 4; i <= 7; i++)
356+ // {
357+ // var contact = new Contact { Name = "Test User " + i, ContactTypeId = 2, SumDecimal = 0.5m + i };
358+ // repository.Add(contact);
359+ // }
360+
361+ // var groups = repository.GroupMin(x => x.ContactTypeId, x => x.SumDecimal);
362+
363+ // groups.Count().ShouldBe(2);
364+
365+
366+ // groups[1].ShouldBe(1.5m);
367+ // groups[2].ShouldBe(4.5m);
368+ //}
369+
370+ //[ExecuteForAllRepositoriesExcept(RepositoryType.CouchDb, RepositoryType.MongoDb, RepositoryType.RavenDb, Reason = "GroupBy Not Supported")]
371+ //public void GroupMax_Should_Return_Proper_Counts(IRepository<Contact, string> repository)
372+ //{
373+ // for (var i = 1; i <= 3; i++)
374+ // {
375+ // var contact = new Contact { Name = "Test User " + i, ContactTypeId = 1, SumDecimal = 0.5m + i };
376+ // repository.Add(contact);
377+ // }
378+ // for (var i = 4; i <= 7; i++)
379+ // {
380+ // var contact = new Contact { Name = "Test User " + i, ContactTypeId = 2, SumDecimal = 0.5m + i };
381+ // repository.Add(contact);
382+ // }
383+
384+ // var groups = repository.GroupBy(x => x.ContactTypeId,
385+ // x => new { Key = x.Key, Max = x.Max(o => o.SumDecimal) });
386+
387+ // var groups = repository.GroupMax(x => x.ContactTypeId, x => x.SumDecimal);
388+
389+ // groups.Count().ShouldBe(2);
390+ // groups.First().Key.ShouldBe(1);
391+ // groups.First().Max.ShouldBe(3.5m);
392+ // groups.Last().Key.ShouldBe(2);
393+ // groups.Last().Max.ShouldBe(7.5m);
394+ // groups[1].ShouldBe(3.5m);
395+ // groups[2].ShouldBe(7.5m);
396+ //}
398397
399398 }
400399}
0 commit comments