Exemple #1
0
        public void ListOf4Site_SizeGrouperIs2_ShouldGroupInto2Groups()
        {
            List <Site> sites       = CreateSiteListOfSize(4);
            var         sizeGrouper = new SizeGrouper(2);

            var groupedSites = sizeGrouper.Group(sites);

            Assert.Equal(2, groupedSites.Count);
        }
Exemple #2
0
        public void NotProduceNullMeasurements(int dataSize, int sizeOfEachGroup, int numberOfGroups)
        {
            // Arrange
            var measurements = mother.CreateMeasurementListOfSize(dataSize);
            var grouper      = new SizeGrouper(sizeOfEachGroup);

            // Act
            var groupedResults = grouper.Group(measurements);

            // Assert
            Assert.True(groupedResults.All(result => !result.Contains(null)));
        }
Exemple #3
0
        public void ProduceGroupOfSizeIfListOfOneIsGroupedBy(int dataSize, int sizeOfEachGroup, int numberOfGroups)
        {
            // Arrange
            var measurements = mother.CreateMeasurementListOfSize(dataSize);

            // Act
            var grouper        = new SizeGrouper(sizeOfEachGroup);
            var groupedResults = grouper.Group(measurements);

            // Assert
            Assert.Equal(numberOfGroups, groupedResults.Count());
            Assert.True(groupedResults.All(g => g.Count() == sizeOfEachGroup));
        }
Exemple #4
0
        public void Grouping_List_of_One_by_One_Produces_groupOfOne()
        {
            var measurements = new List<Measurement>()
            {
                new Measurement() { HighValue =10, LowValue = 1}
            };
            
            var grouper = new SizeGrouper(10);
            var groupedResultes = grouper.Group(measurements);

            Assert.AreEqual(1, groupedResultes.Count);

        }