static void Main(string[] args) { var rl = new RandomList(); Console.WriteLine(rl.RandomInteger()); rl.Add("ggg"); rl.Add(1); rl.Add("ttt"); var test = rl[0]; // Type - Object var test1 = rl[1]; // Type - Object }
public static void Main() { var rl = new RandomList(); Console.WriteLine(rl.randomInteger()); rl.Add("ggg"); rl.Add(1); rl.Add("ttt"); var test = rl[0]; var test1 = rl[1]; }
static void Main(string[] args) { // Random rnd = new Random(); RandomList rnd = new RandomList(); rnd.Add("pesho"); rnd.Add("gosho"); rnd.Add("Ivan"); rnd.Add("kiro"); //rnd.RemoveRandomElemnt(rnd); }
/// <summary> /// Constructor /// </summary> /// <param name="Representative"><see cref="Client"/> choosen as representative of a <see cref="Species"/></param> public Species(Client Representative) { Clients = new RandomList <Client>(); this.Representative = Representative; this.Representative.Species = this; Clients.Add(Representative); }
static void Main() { var randomtext = new RandomList(); randomtext.Add("petko"); randomtext.Add("gosho"); randomtext.Add("ivan"); randomtext.Add("ivan"); randomtext.Add("dragan"); Console.WriteLine(randomtext.RandomString()); Console.WriteLine(randomtext.RandomString()); foreach (var item in randomtext) { Console.WriteLine($"{item} left in the list"); } }
public virtual ISubscription subscribe(Act <A> onChange) { var subscription = new Subscription(onUnsubscribed); // We can safely add to the subscriptions lists end. subscriptions.Add(F.t(subscription, onChange)); // Subscribe to source if we have a first subscriber. sourceProps.each(_ => _.trySubscribe()); return(subscription); }
static void Main() { var randomList = new RandomList(); randomList.Add("Bay"); randomList.Add("May"); randomList.Add("Kay"); randomList.Add("KAy"); randomList.Add("KaY"); randomList.RemoveRandomString(); randomList.RemoveRandomString(); randomList.RemoveRandomString(); randomList.RemoveRandomString(); for (int i = 0; i < 5; i++) { Console.WriteLine(randomList.RandomString()); } }
public Coroutine after(Duration duration, Action act, string name) { TestTimeContextCoroutine cr = null; // ReSharper disable once PossibleNullReferenceException var entry = F.t(timePassed + duration, (Action)(() => cr.timeHit()), name); cr = new TestTimeContextCoroutine(() => actions.Remove(entry)); cr.onFinish += act; actions.Add(entry); return(cr); }
static void Main(string[] args) { RandomList randomList = new RandomList(); randomList.Add("test 1"); randomList.Add("test 2"); randomList.Add("test 3"); Console.WriteLine("Total Items: "); foreach (string s in randomList) { Console.WriteLine(s); } Console.WriteLine($"Item Removed: {randomList.RandomString()}"); Console.WriteLine("Item Remains: "); foreach (string s in randomList) { Console.WriteLine(s); } }
public void AddingItems(int itemsCount) { // Arrange var randList = new RandomList <int>(); // Act for (int i = 0; i < itemsCount; i++) { randList.Add(i); } // Assert Assert.True(itemsCount == randList.Count); }
public void ClearList() { // Arrange var randList = new RandomList <int>(); for (int i = 0; i < 10; i++) { randList.Add(i); } // Act randList.Clear(); // Assert Assert.True(0 == randList.Count); }
static void Main(string[] args) { RandomList randomlist = new RandomList(); for (int i = 0; i < 10; i++) { //Vkarvame neshta v spisuka randomlist.Add("Pesho" + i); } //Printirame Random element ot spisuka koito napulnihme Console.WriteLine(randomlist.RandomElement()); //Printirame vsichki elementi v spisuka foreach (var pesho in randomlist) { Console.WriteLine(pesho); } }
public void after(Duration duration, Action act) => actions.Add(F.t(timePassed + duration, act));