Exemplo n.º 1
0
        public void PBScrape_CountsDatabaseEntries_1()
        {
            PBScrape newScrape = new PBScrape();

            newScrape.Save();
            List <PBScrape> allScrapes = PBScrape.GetAll();
            int             count      = allScrapes.Count;

            Assert.AreEqual(1, count);
        }
Exemplo n.º 2
0
        public List <string> Get(int id)
        {
            List <PBScrape> allScrapes    = PBScrape.GetAll();
            PBScrape        currentScrape = allScrapes[id - 1];
            List <string>   allProperties = new List <string>();

            allProperties.Add(currentScrape.GetId().ToString());
            allProperties.Add(currentScrape.GetKeyword());
            allProperties.Add(currentScrape.GetUrl());
            allProperties.Add(currentScrape.GetPhone());
            allProperties.Add(currentScrape.GetEmail());
            return(allProperties);
        }
Exemplo n.º 3
0
        public List <string> Get()
        {
            List <PBScrape> allScrapes    = PBScrape.GetAll();
            List <string>   allProperties = new List <string>();

            for (int i = 0; i < allScrapes.Count; i++)
            {
                allProperties.Add(allScrapes[i].GetId().ToString());
                allProperties.Add(allScrapes[i].GetKeyword());
                allProperties.Add(allScrapes[i].GetUrl());
                allProperties.Add(allScrapes[i].GetPhone());
                allProperties.Add(allScrapes[i].GetEmail());
            }
            return(allProperties);
        }
Exemplo n.º 4
0
        public string Get()
        {
            List <PBScrape>             allScrapes = PBScrape.GetAll();
            Dictionary <string, string> allKeys    = new Dictionary <string, string>();

            for (int i = 0; i < allScrapes.Count; i++)
            {
                allKeys.Add("id", allScrapes[i].GetId().ToString());
                allKeys.Add("keyword", allScrapes[i].GetKeyword());
                allKeys.Add("url", allScrapes[i].GetUrl());
                allKeys.Add("email", allScrapes[i].GetEmail());
                allKeys.Add("phone", allScrapes[i].GetPhone());
            }
            string json = JsonConvert.SerializeObject(allKeys);

            return(json);
        }