Example #1
0
 public void You_May_Pick_More_Than_One_Carefully()
 {
     10.Times(
         () =>
         {
             var ints = new[] { 1, 2, 3, 4 };
             Assert.Throws<BeingPicky.TheNumberOfElementsToPickMustBeSmallerThanTheNumberOfPossibleChoices>(
                 () => ints.Pick(5));
         });
 }
Example #2
0
 public void Does_not_Quote_Repick_Unquote()
 {
     var list = new[] { 1, 2, 3, 4, 5 };
     10.Times(
         () =>
             {
                 var newList = list.Pick(2).ToList();
                 Assert.NotEqual(newList.First(), newList.Last());
             });
 }
Example #3
0
 public void You_May_Pick_More_Than_One()
 {
     var ints = new[] { 1, 2, 3, 5 };
     10.Times(
         () =>
         {
             var twoInts = ints.Pick(2);
             Assert.Equal(2, twoInts.Count());
             Assert.NotEqual(twoInts.First(), twoInts.Last());
         });
 }
Example #4
0
 public void Returns_the_correct_number_of_elements()
 {
     var list = new[] {1, 2, 3, 4, 5};
     var newList = list.Pick(2);
     Assert.Equal(2, newList.Count());
 }