public void Coefficient_should_not_be_lower_than_1() { var coefficient = new CoefficientDomainModel() { CoefficientValue = -3 }; Assert.Throws <Exception>(() => coefficient.ErrorCheck()); }
private static List <CoefficientDomainModel> GenerateRandomCoefficients() { Random rand = new Random(); var items = new List <CoefficientDomainModel>(); var numberOfCoefficients = rand.Next(1, Enum.GetValues(typeof(BetType)).Length); var coefficients = Enum.GetValues(typeof(BetType)).Cast <int>().ToList().OrderBy(x => rand.Next()).ToArray(); for (var i = 0; i < numberOfCoefficients; i++) { var coefficient = new CoefficientDomainModel((BetType)coefficients[i], (float)(rand.Next(1, 3) + Math.Round(rand.NextDouble(), 2))); items.Add(coefficient); } return(items); }