public void TestSetup() { _categories = new List <string>(); while (_categories.Count < maxCategories) { string cat = String.Empty; for (int i = 0; i < catLength; i++) { int c = _rng.Next(1, catLabels.Length); cat = cat + catLabels[c]; } if (!_categories.Contains(cat)) { _categories.Add(cat); } } _bigList = new List <PayRecord>(cMaxList); for (int i = 0; i < cMaxList; i++) { string cv = _categories[_rng.Next(0, _categories.Count - 1)]; var pr = new PayRecord { PayId = _rng.Next(_basePayId, _basePayId + _uniquePayIds), PaymentAmount = Convert.ToDecimal(_rng.Next(1, 10000)) / 100M, Category = cv }; _bigList.Add(pr); } _myLookup = _bigList.ToLookup(p => p.PayId, p => p); }
public void TestSetup() { _bigList = new List<PayRecord>(cMaxList); for (int i = 0; i < cMaxList; i++) { string cv = "++"; switch (_rng.Next(1, 4)) { case 1: cv = "AB"; break; case 2: cv = "CD"; break; case 3: cv = "XY"; break; case 4: cv = "**"; break; } var pr = new PayRecord { PayId = _rng.Next(1000000, 1000300), PaymentAmount = Convert.ToDecimal(_rng.Next(1, 10000))/100M, CategoryCode = cv }; _bigList.Add(pr); } _myLookup = _bigList.ToLookup(p => p.PayId, p => p); }