예제 #1
0
 public void AddrecognitionRowTest1()
 {
     AutoWebAgentDBDataSet.recognitionDataTable target = new AutoWebAgentDBDataSet.recognitionDataTable(); // TODO: Initialize to an appropriate value
     AutoWebAgentDBDataSet.recognitionRow       row    = null;                                             // TODO: Initialize to an appropriate value
     target.AddrecognitionRow(row);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
예제 #2
0
        public void AutoWebAgentDBDataSet_recognitionRowConstructorTest()
        {
            DataRowBuilder rb = null; // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.recognitionRow target = new AutoWebAgentDBDataSet.recognitionRow(rb);
            Assert.Inconclusive("TODO: Implement code to verify target");
        }
예제 #3
0
        public void SetpriorityNullTest()
        {
            DataRowBuilder rb = null;                                                                   // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.recognitionRow target = new AutoWebAgentDBDataSet.recognitionRow(rb); // TODO: Initialize to an appropriate value
            target.SetpriorityNull();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
예제 #4
0
        public void AutoWebAgentDBDataSet_recognitionRowChangeEventConstructorTest()
        {
            AutoWebAgentDBDataSet.recognitionRow row = null; // TODO: Initialize to an appropriate value
            DataRowAction action = new DataRowAction();      // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.recognitionRowChangeEvent target = new AutoWebAgentDBDataSet.recognitionRowChangeEvent(row, action);
            Assert.Inconclusive("TODO: Implement code to verify target");
        }
예제 #5
0
 public void NewrecognitionRowTest()
 {
     AutoWebAgentDBDataSet.recognitionDataTable target   = new AutoWebAgentDBDataSet.recognitionDataTable(); // TODO: Initialize to an appropriate value
     AutoWebAgentDBDataSet.recognitionRow       expected = null;                                             // TODO: Initialize to an appropriate value
     AutoWebAgentDBDataSet.recognitionRow       actual;
     actual = target.NewrecognitionRow();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
예제 #6
0
        public int SetElement(AutoWebAgentDBDataSet.websiteRow WebsiteRow, string elementName, string elementType, List <RecognitionProperty> elementProperties)
        {
            AutoWebAgentDBDataSet.elementRow eid;

            // find(by name) if the element is already in the database
            // assuming names are unique per websie
            //var result = from elm in dal.DB.element
            //             join ws in dal.DB.website on elm.website_id equals ws.id
            //             where elm.name == elementNameTextBox.Text
            //             select elm;
            var result = from elm in DB.element
                         from ws in DB.website
                         where (elm.name == elementName) && (elm.website_id == ws.id)
                         select elm;

            if (result.Count() == 1) // need update
            {
                result.ElementAt(0).type = elementType;
                eid = result.ElementAt(0);
            }
            else if (result.Count() == 0)// new row
            {
                awaDAL.AutoWebAgentDBDataSet.elementRow row = DB.element.AddelementRow(elementName, WebsiteRow, elementType);
                SaveChanges("element");
                result = from elm in DB.element
                         from ws in DB.website
                         where (elm.name == elementName) && (elm.website_id == ws.id)
                         select elm;
                eid = result.ElementAt(0);
            }
            else // multiple elements in site with same name detected
            {
                throw new Exception("multiple elements in site with same name detected");
            }

            // update recognition table by droping element's properties and re-adding them
            var recResult = from row in DB.recognition
                            where (row.element_id == eid.id)
                            select row;

            foreach (var item in recResult)
            {
                item.Delete();
            }

            int rowsAffected;//= dal.SaveChanges("recognition");

            foreach (var item in elementProperties)
            {
                AutoWebAgentDBDataSet.recognitionRow row = DB.recognition.AddrecognitionRow(item.Attribute, item.Priority, item.Value, eid);
            }

            // rowsAffected = dal.SaveChanges("element");
            rowsAffected = SaveChanges("recognition");
            return(0);
        }
예제 #7
0
        public void RowTest()
        {
            AutoWebAgentDBDataSet.recognitionRow row = null;                                                                           // TODO: Initialize to an appropriate value
            DataRowAction action = new DataRowAction();                                                                                // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.recognitionRowChangeEvent target = new AutoWebAgentDBDataSet.recognitionRowChangeEvent(row, action); // TODO: Initialize to an appropriate value
            AutoWebAgentDBDataSet.recognitionRow            actual;
            actual = target.Row;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
예제 #8
0
        public void IspriorityNullTest()
        {
            DataRowBuilder rb = null;                                                                   // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.recognitionRow target = new AutoWebAgentDBDataSet.recognitionRow(rb); // TODO: Initialize to an appropriate value
            bool expected = false;                                                                      // TODO: Initialize to an appropriate value
            bool actual;

            actual = target.IspriorityNull();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
예제 #9
0
        public void elementRowTest()
        {
            DataRowBuilder rb = null;                                                                     // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.recognitionRow target   = new AutoWebAgentDBDataSet.recognitionRow(rb); // TODO: Initialize to an appropriate value
            AutoWebAgentDBDataSet.elementRow     expected = null;                                         // TODO: Initialize to an appropriate value
            AutoWebAgentDBDataSet.elementRow     actual;
            target.elementRow = expected;
            actual            = target.elementRow;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
예제 #10
0
        public void attributeTest()
        {
            DataRowBuilder rb = null;                                                                   // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.recognitionRow target = new AutoWebAgentDBDataSet.recognitionRow(rb); // TODO: Initialize to an appropriate value
            string expected = string.Empty;                                                             // TODO: Initialize to an appropriate value
            string actual;

            target.attribute = expected;
            actual           = target.attribute;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
예제 #11
0
        public void AddrecognitionRowTest()
        {
            AutoWebAgentDBDataSet.recognitionDataTable target = new AutoWebAgentDBDataSet.recognitionDataTable(); // TODO: Initialize to an appropriate value
            string attribute = string.Empty;                                                                      // TODO: Initialize to an appropriate value
            int    priority  = 0;                                                                                 // TODO: Initialize to an appropriate value
            string value     = string.Empty;                                                                      // TODO: Initialize to an appropriate value

            AutoWebAgentDBDataSet.elementRow     parentelementRowByFK_element_recognition = null;                 // TODO: Initialize to an appropriate value
            AutoWebAgentDBDataSet.recognitionRow expected = null;                                                 // TODO: Initialize to an appropriate value
            AutoWebAgentDBDataSet.recognitionRow actual;
            actual = target.AddrecognitionRow(attribute, priority, value, parentelementRowByFK_element_recognition);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }