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("*****@*****.**"); }
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); }