Example #1
0
 FuzzyListTest()
 {
     minCount  = 1 + random.Next() % 10;
     maxCount  = minCount + 1 + random.Next() % 10;
     itemCount = Count.Between(minCount, maxCount);
     sut       = new FuzzyList <TestItem>(fuzzy, itemFactory, itemCount);
 }
Example #2
0
 FuzzyDictionaryTest()
 {
     minCount = 1 + random.Next() % 10;
     maxCount = minCount + 1 + random.Next() % 10;
     count    = Count.Between(minCount, maxCount);
     sut      = new FuzzyDictionary <TestKey, TestValue>(fuzzy, keyFactory, valueFactory, count);
 }
Example #3
0
 public void CreateDictionaryOfExistingElementsWithCountSpecification()
 {
     var existing = new Dictionary <int, string> {
         [41] = "foo", [42] = "bar", [43] = "baz"
     };
     Dictionary <int, string> selected = fuzzy.Dictionary(existing, Count.Between(2, 3));
 }
Example #4
0
        public void ControlListCount()
        {
            List <int> values;

            values = fuzzy.List(fuzzy.Int32, Count.Exactly(42));
            values = fuzzy.List(fuzzy.Int32, Count.Between(41, 43));
            values = fuzzy.List(fuzzy.Int32, Count.Max(43));
            values = fuzzy.List(fuzzy.Int32, Count.Min(5));
        }
Example #5
0
        public void ControlDictionaryCount()
        {
            Dictionary <int, string> dictionary;

            dictionary = fuzzy.Dictionary(fuzzy.Int32, fuzzy.String, Count.Exactly(42));
            dictionary = fuzzy.Dictionary(fuzzy.Int32, fuzzy.String, Count.Between(41, 43));
            dictionary = fuzzy.Dictionary(fuzzy.Int32, fuzzy.String, Count.Max(43));
            dictionary = fuzzy.Dictionary(fuzzy.Int32, fuzzy.String, Count.Min(5));
        }
Example #6
0
 public void CreateListOfCustomElementsWithCountConstraints()
 {
     List <int> values = fuzzy.List(() => Environment.TickCount, Count.Between(42, 43));
 }
Example #7
0
 public void CreateListOfExistingElementsWithCountConstraints()
 {
     IEnumerable <int> existing = new[] { 41, 42, 43, 44, 45 };
     List <int>        selected = fuzzy.List(existing, Count.Between(2, 4));
 }
Example #8
0
 public void CreateListOfFuzzyElementsWithCountSpecification()
 {
     List <int> values = fuzzy.List(fuzzy.Int32, Count.Between(41, 43));
 }
Example #9
0
 public void CreateArrayOfCustomElementsWithCountSpecification()
 {
     int key = Environment.TickCount;
     Dictionary <int, string> values = fuzzy.Dictionary(() => key++, k => $"value{k}", Count.Between(42, 43));
 }
Example #10
0
 public void CreateDictionaryOfFuzzyElementsWithCountSpecification()
 {
     Dictionary <int, string> values = fuzzy.Dictionary(fuzzy.Int32, fuzzy.String, Count.Between(41, 43));
 }