Esempio n. 1
0
        public void TestMethod1()
        {
            var xClients = new Collection <int>();

            for (var i = 0; i <= 20; i++)
            {
                xClients.Add(i);
            }

            var xSucess = true;

            //simulation 20 requests
            Parallel.ForEach(xClients, (iClient, iState) =>
            {
                var xData = HackNewsWrapper.GetData();

                if (xData == null)
                {
                    xSucess = false;
                    iState.Break();
                }
            });

            Assert.AreEqual(xSucess, true);
        }
Esempio n. 2
0
 public IEnumerable <dynamic> Get()
 {
     return(HackNewsWrapper.GetData());
 }