public static IEnumerable <TestCaseData> GetAccCountTestData() { Random rnd = new Random(); //Создаем массив из перечисления Array values = Enum.GetValues(typeof(PersonalAccountStatuses)); //Вытягиваем рандомно элемент PersonalAccountStatuses randomStatus = (PersonalAccountStatuses)values.GetValue(rnd.Next(values.Length)); //PersonalAccountStatuses randomStatus = PersonalAccountStatuses.Active; yield return(new TestCaseData(randomStatus, 200)); }
public static void ChangePersonalAccountStatus(Guid accountId, PersonalAccountStatuses status) { using (var context = new DatabaseContext()) { var account = context.Accounts .Where(c => c.Id == accountId) .FirstOrDefault(); if (account != null) { account.PersonalAccountStatus = status; context.SaveChanges(); } } }
public static void AddParametersToGetAccCount(PersonalAccountStatuses randomStatus) { RequestHelperInt.gRequestGetAccountCount .AddParameter("status", randomStatus, ParameterType.QueryString); }