public void Add_New_RunTest()
 {
     EF_RunDataRepository target = new EF_RunDataRepository();
     string name = "this was a new run";
     List<DataLabel> labels = new List<DataLabel>() { new DataLabel(name) };
     target.Add_New_Run(name, labels);
     Assert.IsNotNull(target.Get_RunData_object(name).DataLabels[0]);
     target.Delete_RunData_object(name);
 }
 public void Add_RunElement_to_RunDataTest()
 {
     EF_RunDataRepository target = new EF_RunDataRepository();
     string name = "Test Run";
     int runNumber = 43;
     target.Add_New_Run(name, new List<DataLabel>());// add object to db
     RunElement element = new RunElement(new List<float>(), runNumber);
     bool expected = true;
     bool actual;
     actual = target.Add_RunElement_to_RunData(name, element);
     Assert.AreEqual(expected, actual);
     Assert.AreEqual(runNumber, target.Get_RunData_object(name).Runs[0].Number);
     actual = target.Delete_RunData_object(name);    //delect the object
     Assert.IsTrue(actual);
 }
        public void Delete_RunData_objectTest()
        {
            SolarsplashEntities db = new SolarsplashEntities();
            EF_RunDataRepository target = new EF_RunDataRepository(db, true);
            RunData item = new RunData();
            string name = "this should be deleted";
            item.Name = name;
            bool expected = true;
            bool actual;

            target.Add_New_Run(name, new List<DataLabel> {new DataLabel(name) });// add object to db
            int DataLabel_id = target.Get_RunData_object(name).DataLabels[0].id_DataLabel;

            Assert.IsNotNull(target.Get_RunData_base_object(name));
            actual = target.Delete_RunData_object(item);    //delete the object
            Assert.AreEqual(expected, actual);
            Assert.IsNull(target.Get_RunData_base_object(name));
            Assert.IsNull(db.DataLabel.Find(DataLabel_id)); // test to make sure child object got deleted as well
        }