示例#1
0
        public void PBScrape_SetsAndRetrievesKeyword_IsTrue()
        {
            //Arrange
            PBScrape newScrape = new PBScrape();

            //Assert
            newScrape.SetKeyword("Seattle Flowers");
            Assert.AreEqual("Seattle Flowers", newScrape.GetKeyword());
        }
示例#2
0
        public void PBScrape_RetrievedURLSInList_NotEqualToZero()
        {
            //Arrange
            string   Keyword   = "Sandwhich";
            PBScrape newScrape = new PBScrape(Keyword);

            //Act
            newScrape.GetGoogleResults(newScrape.GetKeyword());
            List <string> urlList = newScrape.GetUrls();

            //Assert
            Assert.AreNotEqual(0, urlList);
        }
示例#3
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);
        }
示例#4
0
        public void PBScrape_SavesStaticVariables_IsTrue()
        {
            PBScrape newScrape = new PBScrape();

            string Keyword  = newScrape.GetKeyword();
            bool   TestBool = false;

            if (Keyword == "Bongos")
            {
                TestBool = true;
            }
            Assert.AreEqual(TestBool, true);
        }
        public void PBScrape_SavesStaticVariables_IsTrue()
        {
            PBScrape newScrape = new PBScrape();

            newScrape.Save();
            int    Id       = newScrape.GetId();
            string Keyword  = newScrape.GetKeyword();
            string Url      = newScrape.GetUrl();
            string Phone    = newScrape.GetPhone();
            string Email    = newScrape.GetEmail();
            bool   TestBool = false;

            if (Id == 0 && Keyword == "Bongos" && Url == "https://Bongos.com" && Phone == "333-333-3333" && Email == "*****@*****.**")
            {
                TestBool = true;
            }
            Assert.AreEqual(TestBool, true);
        }