コード例 #1
0
        public void Ordering_sample_decending()
        {
            var population = new []
            {
                new Unit {
                    Id = "*****@*****.**"
                },
                new Unit {
                    Id = "*****@*****.**"
                },
                new Unit {
                    Id = "*****@*****.**"
                }
            };

            var sampler = new Sampler();
            var sample  = sampler.CreateSampleWithSize(population, 3);

            // Sample should be sorted in descending order on id
            sample.Length.ShouldBe(3);
            sample[0].Id.ShouldBe("*****@*****.**");
            sample[1].Id.ShouldBe("*****@*****.**");
            sample[2].Id.ShouldBe("*****@*****.**");
        }
コード例 #2
0
        public void Sample_with_size()
        {
            var population = new []
            {
                new Unit {
                    Id = "*****@*****.**"
                },
                new Unit {
                    Id = "*****@*****.**"
                },
                new Unit {
                    Id = "*****@*****.**"
                },
                new Unit {
                    Id = "*****@*****.**"
                }
            };

            var sampler = new Sampler();
            var sample  = sampler.CreateSampleWithSize(population, 3);

            // Sample should contain 3 units
            sample.Length.ShouldBe(3);
        }