Esempio n. 1
0
        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
        }
Esempio n. 2
0
    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];
    }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
 /// <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);
 }
Esempio n. 5
0
    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");
        }
    }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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());
            }
        }
Esempio n. 8
0
        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);
            }
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
        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);
        }
Esempio n. 12
0
    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);
        }
    }
Esempio n. 13
0
 public void after(Duration duration, Action act) =>
 actions.Add(F.t(timePassed + duration, act));