This commit is contained in:
2021-07-21 20:01:01 +00:00
parent 16443202cc
commit 435a00f0d5

View File

@@ -3078,7 +3078,8 @@ namespace AyaNova.Util
{
var l = CustomerUnits.Where(x => x.Key == customerId).FirstOrDefault();//Fake.Random.Long(1, TotalSeededUnits);
var numUnits = l.Value.Count();
var i = Fake.Random.Int(1, numUnits);
//because faker values are INCLUSIVE and this is going to be used as an index on an array need to -1 each end of the range
var i = Fake.Random.Int(0, numUnits-1);
return l.Value[i];
}