public UserTestBuilder() { var firstName = RandomTestDataGenerator.GetFirstName(); _entity = new User() { FirstName = firstName, LastName = RandomTestDataGenerator.GetLastName(), Email = string.Format("{0}{1}@gmail.com", firstName, StaticRandomNumberGenerator.Next(1, 1000)), Address = RandomTestDataGenerator.GetAddress(), City = RandomTestDataGenerator.GetCity(), Country = RandomTestDataGenerator.GetCountry(), Organization = RandomTestDataGenerator.GetCompany(), Phone = RandomTestDataGenerator.GetPhone(), Tickets = new List <Ticket>() }; }
public static string GetPhone() { return(string.Format("+1 {0} {1} {2}", StaticRandomNumberGenerator.Next(100, 999), StaticRandomNumberGenerator.Next(100, 999), StaticRandomNumberGenerator.Next(1000, 9999))); }
public static string GetAddress() { return(string.Format("{0} st. {1}", _streets.TakeRandom(), StaticRandomNumberGenerator.Next(100) + 1)); }
public static T TakeRandom <T>(this IEnumerable <T> list) { int rnd = StaticRandomNumberGenerator.Next(1, list.Count()) - 1; return(list.ToList()[rnd]); }