ListEvents() public method

public ListEvents ( ) : List
return List
Ejemplo n.º 1
0
        public void TestProjectEventContactCreate()
        {
            bool PrimaryContact = true;
            var ProjectEventContact_bll = new sp_ProjectEventContact_BLL();
            var ProjectEventContact_dm = new sp_ProjectEventContact_DM();
            var ProjectEvent_bll = new sp_ProjectEvent_BLL();
            var Contact_bll = new sp_Contact_BLL();
            ProjectEventContact_dm.PrimaryContact = PrimaryContact;

            var allProjectEvents = ProjectEvent_bll.ListEvents();
            Assert.IsTrue(allProjectEvents.Count > 0, "The ListEvents() is broken, or no data in DB");
            ProjectEventContact_dm.EventID = allProjectEvents[0].EventID;

            var allContacts = Contact_bll.ListContacts();
            Assert.IsTrue(allContacts.Count > 0, "The ListContacts() is broken, or no data in DB");
            ProjectEventContact_dm.ContactID = allContacts[0].ContactID;

            ProjectEventContact_bll.InsertProjectEventContactContext(ProjectEventContact_dm);

            var ProjectEventContact_dm_selected = ProjectEventContact_bll.ListEventsContacts(
                                                                ProjectEventContact_dm.EventID,
                                                                ProjectEventContact_dm.ContactID);
            Assert.AreEqual(1, ProjectEventContact_dm_selected.Count);
            Assert.IsTrue(Equals(ProjectEventContact_dm, ProjectEventContact_dm_selected[0]));
        }
Ejemplo n.º 2
0
        public void TestProjectEventDelete()
        {
            var ProjectEvent_bll = new sp_ProjectEvent_BLL();
            var allProjectEvents = ProjectEvent_bll.ListEvents();
            Assert.IsTrue(allProjectEvents.Count > 0, "The ListProjectEvents() is broken, or no data in DB");
            var currProjectEvent = allProjectEvents[0];

            var numRows = cExcel.getNumRecordsFromDB("[Vend].[tblProjectEvent]");

            //ProjectEvent_bll.DeleteEventContext(currProjectEvent);
            var selectedProjectEvent = ProjectEvent_bll.ListEvent(currProjectEvent.EventID);

            var numCurrRows = cExcel.getNumRecordsFromDB("[Vend].[tblProjectEvent]");

            Assert.AreEqual(numRows - 1, numCurrRows);
        }
Ejemplo n.º 3
0
        public void TestEventRatingCreate()
        {
            DateTime StartDate = new DateTime(2014, 05, 01, 10, 0, 0);
            DateTime EndDate = new DateTime(2014, 05, 02, 11, 0, 0);
            var EventRating_bll = new sp_EventRating_BLL();
            var EventRating_dm = new sp_EventRating_DM();
            var Event_bll = new sp_ProjectEvent_BLL();

            var allEvents = Event_bll.ListEvents();
            Assert.IsTrue(allEvents.Count > 0, "The ListEventRatings() is broken, or no data in DB");
            EventRating_dm.EventID = allEvents[0].EventID;
            EventRating_dm.ActiveFlg = true;
            int RatingID = EventRating_bll.InsertEventRatingContext(EventRating_dm).RatingID;
            EventRating_dm.RatingID = RatingID;

            var EventRating_dm_selected = EventRating_bll.ListEventRatings(RatingID);
            Assert.IsTrue(Equals(EventRating_dm, EventRating_dm_selected));
        }
Ejemplo n.º 4
0
        public void TestProjectEventRead()
        {
            //Pull our data from the excel file
            string helperDir = cExcel.GetHelperFilesDir();
            DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(helperDir, "ProjectEvent.xlsx"));
            var excelDMs = DMsFrom(dt);
            //Pull our data directly from the DB
            var numRows = cExcel.getNumRecordsFromDB("[Vend].[tblProjectEvent]");

            //Pull our data from the DB through the BLL
            var ProjectEvent_bll = new sp_ProjectEvent_BLL();
            var allProjectEvents = ProjectEvent_bll.ListEvents();

            //Test the data from the BLL
            Assert.AreEqual(numRows, allProjectEvents.Count);
            foreach (var testProjectEvent in excelDMs)
            {
                var selectedProjectEvent = ProjectEvent_bll.ListEvent(testProjectEvent.EventID);
                Assert.IsTrue(Equals(testProjectEvent, selectedProjectEvent));
            }
        }
Ejemplo n.º 5
0
        public void TestProjectEventUpdate()
        {
            var ProjectEvent_bll = new sp_ProjectEvent_BLL();
            var allProjectEvents = ProjectEvent_bll.ListEvents();
            Assert.IsTrue(allProjectEvents.Count > 0, "The ListEvents() is broken, or no data in DB");
            var firstProjectEvent = allProjectEvents[0];
            DateTime StartDate = new DateTime(1998, 02, 03, 1, 2, 3);
            DateTime EndDate = new DateTime(1999, 04, 05, 3, 2, 1);
            firstProjectEvent.StartDateTime = StartDate;
            firstProjectEvent.EndDateTime = EndDate;
            //ProjectEvent_bll.UpdateEventContext(firstProjectEvent);
            var selectedProjectEvent = ProjectEvent_bll.ListEvent(firstProjectEvent.EventID);

            Assert.IsTrue(Equals(firstProjectEvent, selectedProjectEvent));
            Assert.AreEqual(StartDate, selectedProjectEvent.StartDateTime);
            Assert.AreEqual(EndDate, selectedProjectEvent.EndDateTime);
        }