Exemplo n.º 1
0
        public FakeTwitRepository()
        {
            FakeTwit ft1 = new FakeTwit {
                userId = "Hammon", profileImageUrl = @"http://forum.adunanza.net/image.php?u=1&dateline=1294398092", text = "Il mondo e' mio!!"
            };
            FakeTwit ft2 = new FakeTwit {
                userId = "", profileImageUrl = @"http://forum.adunanza.net/image.php?u=39429&dateline=1216736785", text = "Aaah Ahhh..."
            };
            FakeTwit ft3 = new FakeTwit {
                userId = "3", profileImageUrl = @"http://forum.adunanza.net/image.php?u=38944&dateline=1297260296", text = "Chi va con lo zoppo va piano."
            };

            faketwits.Add(ft1);
            faketwits.Add(ft2);
            faketwits.Add(ft3);
        }
Exemplo n.º 2
0
        public FakeTwit Store(FakeTwit faketwit)
        {
            if (faketwit.userId == default(string))
            {
                faketwit.userId = faketwit.userId;
            }
            else
            {
                for (var i = 0; i < faketwits.Count; i++)
                {
                    if (faketwits[i].userId != faketwit.userId)
                    {
                        continue;
                    }

                    faketwits[i] = faketwit;
                    return(faketwit);
                }
            }

            faketwits.Add(faketwit);
            return(faketwit);
        }