public void Create_ShouldSucceed()
        {
            // Insert the master data rows in the database.
            int courseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Build the CourseGroup data row.
            CourseGroupDataRow courseGroupDataRow = new CourseGroupDataRow();
            courseGroupDataRow.CourseGroupCode = "5s1cgndj6e5x0uvz";
            courseGroupDataRow.CourseScheduleID = courseScheduleID;
            courseGroupDataRow.PlacesCount = 1;

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Create the CourseGroup data row.
                CourseGroupDataAccessComponent courseGroupDataAccessComponent = new CourseGroupDataAccessComponent();
                courseGroupDataAccessComponent.Create(databaseConnection, courseGroupDataRow).Wait();
            }

            // Validate the CourseGroupID was generated.
            Assert.AreNotEqual(0, courseGroupDataRow.CourseGroupID);

            // Validate the CourseGroup data row was inserted in the database.
            CourseGroupTestTable.AssertPresence(
                courseGroupDataRow.CourseGroupID,
                "5s1cgndj6e5x0uvz",
                courseScheduleID,
                1);
        }
        public void Create_ShouldSucceed()
        {
            // Insert the master data rows in the database.
            int sessionID = SessionTestTable.InsertPlaceholder();

            // Build the CourseSchedule data row.
            CourseScheduleDataRow courseScheduleDataRow = new CourseScheduleDataRow();
            courseScheduleDataRow.CourseScheduleCode = "zzcj32kpd6huzp1n";
            courseScheduleDataRow.SessionID = sessionID;
            courseScheduleDataRow.DayOfWeek = 1;
            courseScheduleDataRow.Time = new TimeSpan(9, 15, 0);

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Create the CourseSchedule data row.
                CourseScheduleDataAccessComponent courseScheduleDataAccessComponent = new CourseScheduleDataAccessComponent();
                courseScheduleDataAccessComponent.Create(databaseConnection, courseScheduleDataRow).Wait();
            }

            // Validate the CourseScheduleID was generated.
            Assert.AreNotEqual(0, courseScheduleDataRow.CourseScheduleID);

            // Validate the CourseSchedule data row was inserted in the database.
            CourseScheduleTestTable.AssertPresence(
                courseScheduleDataRow.CourseScheduleID,
                "zzcj32kpd6huzp1n",
                sessionID,
                1,
                new TimeSpan(9, 15, 0));
        }
        public void Create_ShouldThrowException_GivenDuplicateSessionCode()
        {
            // Insert the duplicate Session data row in the database.
            int sessionID = SessionTestTable.InsertPlaceholder(sessionCode: "6dk61ufcuzp3f7vs");

            // Build the Session data row.
            SessionDataRow sessionDataRow = new SessionDataRow();
            sessionDataRow.SessionCode = "6dk61ufcuzp3f7vs";
            sessionDataRow.Name = "Session Alpha";
            sessionDataRow.StartDate = new DateTime(2001, 1, 1);

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                try
                {
                    // Create the Session data row.
                    SessionDataAccessComponent sessionDataAccessComponent = new SessionDataAccessComponent();
                    sessionDataAccessComponent.Create(databaseConnection, sessionDataRow).Wait();

                    // Validate an exception was thrown.
                    Assert.Fail();
                }
                catch (AggregateException ex)
                {
                    // Validate an SQL exception was thrown.
                    Assert.IsInstanceOfType(ex.InnerExceptions[0], typeof(SqlException));
                }
            }
        }
        public void Create_ShouldSucceed()
        {
            // Build the Session data row.
            SessionDataRow sessionDataRow = new SessionDataRow();
            sessionDataRow.SessionCode = "6dk61ufcuzp3f7vs";
            sessionDataRow.Name = "Session Alpha";
            sessionDataRow.StartDate = new DateTime(2001, 1, 1);

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Create the Session data row.
                SessionDataAccessComponent sessionDataAccessComponent = new SessionDataAccessComponent();
                sessionDataAccessComponent.Create(databaseConnection, sessionDataRow).Wait();
            }

            // Validate the SessionID was generated.
            Assert.AreNotEqual(0, sessionDataRow.SessionID);

            // Validate the Session data row was inserted in the database.
            SessionTestTable.AssertPresence(
                sessionDataRow.SessionID,
                "6dk61ufcuzp3f7vs",
                "Session Alpha",
                new DateTime(2001, 1, 1));
        }
        public void Update_ShouldSucceed()
        {
            // Insert the first master data rows in the database.
            int firstSessionID = SessionTestTable.InsertPlaceholder();

            // Insert the second master data rows in the database.
            int secondSessionID = SessionTestTable.InsertPlaceholder();

            // Insert the CourseSchedule data row in the database.
            int courseScheduleID = CourseScheduleTestTable.InsertWithValues(
                "zzcj32kpd6huzp1n",
                firstSessionID,
                1,
                new TimeSpan(9, 15, 0));

            // Build the CourseSchedule data row.
            CourseScheduleDataRow courseScheduleDataRow = new CourseScheduleDataRow();
            courseScheduleDataRow.CourseScheduleID = courseScheduleID;
            courseScheduleDataRow.CourseScheduleCode = "8zu96quwvk70ng1e";
            courseScheduleDataRow.SessionID = secondSessionID;
            courseScheduleDataRow.DayOfWeek = 2;
            courseScheduleDataRow.Time = new TimeSpan(10, 30, 0);

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Update the CourseSchedule data row.
                CourseScheduleDataAccessComponent courseScheduleDataAccessComponent = new CourseScheduleDataAccessComponent();
                courseScheduleDataAccessComponent.Update(databaseConnection, courseScheduleDataRow).Wait();
            }

            // Validate the CourseSchedule data row was updated in the database.
            CourseScheduleTestTable.AssertPresence(
                courseScheduleID,
                "8zu96quwvk70ng1e",
                secondSessionID,
                2,
                new TimeSpan(10, 30, 0));
        }
        public void ReadByCourseScheduleID_ShouldReturnNull()
        {
            // Insert the master data rows in the database.
            int sessionID = SessionTestTable.InsertPlaceholder();

            // Insert the CourseSchedule data row in the database.
            int courseScheduleID = CourseScheduleTestTable.InsertWithValues(
                "zzcj32kpd6huzp1n",
                sessionID,
                1,
                new TimeSpan(9, 15, 0));

            // Build the database connection.
            CourseScheduleDataRow courseScheduleDataRow = null;
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Read the CourseSchedule data row.
                CourseScheduleDataAccessComponent courseScheduleDataAccessComponent = new CourseScheduleDataAccessComponent();
                courseScheduleDataRow = courseScheduleDataAccessComponent.ReadByCourseScheduleID(databaseConnection, -1).Result;
            }

            // Validate the CourseSchedule data row.
            Assert.IsNull(courseScheduleDataRow);
        }
        public void Update_ShouldSucceed()
        {
            // Insert the Session data row in the database.
            int sessionID = SessionTestTable.InsertWithValues(
                "6dk61ufcuzp3f7vs",
                "Session Alpha",
                new DateTime(2001, 1, 1));

            // Build the Session data row.
            SessionDataRow sessionDataRow = new SessionDataRow();
            sessionDataRow.SessionID = sessionID;
            sessionDataRow.SessionCode = "n3p4y556gt9f17hw";
            sessionDataRow.Name = "Session Bravo";
            sessionDataRow.StartDate = new DateTime(2002, 2, 2);

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Update the Session data row.
                SessionDataAccessComponent sessionDataAccessComponent = new SessionDataAccessComponent();
                sessionDataAccessComponent.Update(databaseConnection, sessionDataRow).Wait();
            }

            // Validate the Session data row was updated in the database.
            SessionTestTable.AssertPresence(
                sessionID,
                "n3p4y556gt9f17hw",
                "Session Bravo",
                new DateTime(2002, 2, 2));
        }
        public void ReadBySessionID_ShouldReturnNull()
        {
            // Insert the Session data row in the database.
            int sessionID = SessionTestTable.InsertWithValues(
                "6dk61ufcuzp3f7vs",
                "Session Alpha",
                new DateTime(2001, 1, 1));

            // Build the database connection.
            SessionDataRow sessionDataRow = null;
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Read the Session data row.
                SessionDataAccessComponent sessionDataAccessComponent = new SessionDataAccessComponent();
                sessionDataRow = sessionDataAccessComponent.ReadBySessionID(databaseConnection, -1).Result;
            }

            // Validate the Session data row.
            Assert.IsNull(sessionDataRow);
        }
        public void ReadAll_ShouldReturnZeroDataRows()
        {
            // Build the database connection.
            SessionDataRow[] sessionDataRows = null;
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Read the Session data rows.
                SessionDataAccessComponent sessionDataAccessComponent = new SessionDataAccessComponent();
                sessionDataRows = sessionDataAccessComponent.ReadAll(databaseConnection).Result;
            }

            // Validate the Session data rows.
            Assert.IsNotNull(sessionDataRows);
            Assert.AreEqual(0, sessionDataRows.Length);
        }
        public void ReadAll_ShouldReturnOneDataRow()
        {
            // Insert the Session data row in the database.
            int sessionID = SessionTestTable.InsertWithValues(
                "6dk61ufcuzp3f7vs",
                "Session Alpha",
                new DateTime(2001, 1, 1));

            // Build the database connection.
            SessionDataRow[] sessionDataRows = null;
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Read the Session data rows.
                SessionDataAccessComponent sessionDataAccessComponent = new SessionDataAccessComponent();
                sessionDataRows = sessionDataAccessComponent.ReadAll(databaseConnection).Result;
            }

            // Validate the Session data rows.
            Assert.IsNotNull(sessionDataRows);
            Assert.AreEqual(1, sessionDataRows.Length);

            // Validate the first Session data row.
            Assert.AreEqual(sessionID, sessionDataRows[0].SessionID);
            Assert.AreEqual("6dk61ufcuzp3f7vs", sessionDataRows[0].SessionCode);
            Assert.AreEqual("Session Alpha", sessionDataRows[0].Name);
            Assert.AreEqual(new DateTime(2001, 1, 1), sessionDataRows[0].StartDate);
        }
        public void ReadAll_ShouldReturnMultipleDataRows()
        {
            // Insert the first Session data row in the database.
            int firstSessionID = SessionTestTable.InsertWithValues(
                "6dk61ufcuzp3f7vs",
                "Session Alpha",
                new DateTime(2001, 1, 1));

            // Insert the second Session data row in the database.
            int secondSessionID = SessionTestTable.InsertWithValues(
                "n3p4y556gt9f17hw",
                "Session Bravo",
                new DateTime(2002, 2, 2));

            // Insert the third Session data row in the database.
            int thirdSessionID = SessionTestTable.InsertWithValues(
                "x36s2tccz8yxp1hq",
                "Session Charlie",
                new DateTime(2003, 3, 3));

            // Build the database connection.
            SessionDataRow[] sessionDataRows = null;
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Read the Session data rows.
                SessionDataAccessComponent sessionDataAccessComponent = new SessionDataAccessComponent();
                sessionDataRows = sessionDataAccessComponent.ReadAll(databaseConnection).Result;
            }

            // Validate the Session data rows.
            Assert.IsNotNull(sessionDataRows);
            Assert.AreEqual(3, sessionDataRows.Length);

            // Validate the first Session data row.
            Assert.AreEqual(firstSessionID, sessionDataRows[0].SessionID);
            Assert.AreEqual("6dk61ufcuzp3f7vs", sessionDataRows[0].SessionCode);
            Assert.AreEqual("Session Alpha", sessionDataRows[0].Name);
            Assert.AreEqual(new DateTime(2001, 1, 1), sessionDataRows[0].StartDate);

            // Validate the second Session data row.
            Assert.AreEqual(secondSessionID, sessionDataRows[1].SessionID);
            Assert.AreEqual("n3p4y556gt9f17hw", sessionDataRows[1].SessionCode);
            Assert.AreEqual("Session Bravo", sessionDataRows[1].Name);
            Assert.AreEqual(new DateTime(2002, 2, 2), sessionDataRows[1].StartDate);

            // Validate the third Session data row.
            Assert.AreEqual(thirdSessionID, sessionDataRows[2].SessionID);
            Assert.AreEqual("x36s2tccz8yxp1hq", sessionDataRows[2].SessionCode);
            Assert.AreEqual("Session Charlie", sessionDataRows[2].Name);
            Assert.AreEqual(new DateTime(2003, 3, 3), sessionDataRows[2].StartDate);
        }
        public void Create_ShouldThrowException_GivenDuplicateCourseGroupCode()
        {
            // Insert the master data rows in the database.
            int courseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the duplicate CourseGroup data row in the database.
            int courseGroupID = CourseGroupTestTable.InsertPlaceholder(courseGroupCode: "5s1cgndj6e5x0uvz");

            // Build the CourseGroup data row.
            CourseGroupDataRow courseGroupDataRow = new CourseGroupDataRow();
            courseGroupDataRow.CourseGroupCode = "5s1cgndj6e5x0uvz";
            courseGroupDataRow.CourseScheduleID = courseScheduleID;
            courseGroupDataRow.PlacesCount = 1;

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                try
                {
                    // Create the CourseGroup data row.
                    CourseGroupDataAccessComponent courseGroupDataAccessComponent = new CourseGroupDataAccessComponent();
                    courseGroupDataAccessComponent.Create(databaseConnection, courseGroupDataRow).Wait();

                    // Validate an exception was thrown.
                    Assert.Fail();
                }
                catch (AggregateException ex)
                {
                    // Validate an SQL exception was thrown.
                    Assert.IsInstanceOfType(ex.InnerExceptions[0], typeof(SqlException));
                }
            }
        }
        public void Update_ShouldThrowException_GivenInvalidCourseScheduleID()
        {
            // Insert the first master data rows in the database.
            int firstCourseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the second master data rows in the database.
            int secondCourseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the CourseGroup data row in the database.
            int courseGroupID = CourseGroupTestTable.InsertWithValues(
                "5s1cgndj6e5x0uvz",
                firstCourseScheduleID,
                1);

            // Build the CourseGroup data row.
            CourseGroupDataRow courseGroupDataRow = new CourseGroupDataRow();
            courseGroupDataRow.CourseGroupID = courseGroupID;
            courseGroupDataRow.CourseGroupCode = "78zcn25ynkaz50ef";
            courseGroupDataRow.CourseScheduleID = -1;
            courseGroupDataRow.PlacesCount = 2;

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                try
                {
                    // Update the CourseGroup data row.
                    CourseGroupDataAccessComponent courseGroupDataAccessComponent = new CourseGroupDataAccessComponent();
                    courseGroupDataAccessComponent.Update(databaseConnection, courseGroupDataRow).Wait();

                    // Validate an exception was thrown.
                    Assert.Fail();
                }
                catch (AggregateException ex)
                {
                    // Validate an SQL exception was thrown.
                    Assert.IsInstanceOfType(ex.InnerExceptions[0], typeof(SqlException));
                }
            }
        }
        public void Update_ShouldSucceed()
        {
            // Insert the first master data rows in the database.
            int firstCourseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the second master data rows in the database.
            int secondCourseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the CourseGroup data row in the database.
            int courseGroupID = CourseGroupTestTable.InsertWithValues(
                "5s1cgndj6e5x0uvz",
                firstCourseScheduleID,
                1);

            // Build the CourseGroup data row.
            CourseGroupDataRow courseGroupDataRow = new CourseGroupDataRow();
            courseGroupDataRow.CourseGroupID = courseGroupID;
            courseGroupDataRow.CourseGroupCode = "78zcn25ynkaz50ef";
            courseGroupDataRow.CourseScheduleID = secondCourseScheduleID;
            courseGroupDataRow.PlacesCount = 2;

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Update the CourseGroup data row.
                CourseGroupDataAccessComponent courseGroupDataAccessComponent = new CourseGroupDataAccessComponent();
                courseGroupDataAccessComponent.Update(databaseConnection, courseGroupDataRow).Wait();
            }

            // Validate the CourseGroup data row was updated in the database.
            CourseGroupTestTable.AssertPresence(
                courseGroupID,
                "78zcn25ynkaz50ef",
                secondCourseScheduleID,
                2);
        }
        public void ReadByCourseScheduleID_ShouldReturnZeroDataRows()
        {
            // Insert the first master data rows in the database.
            int firstCourseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the first CourseGroup data row in the database.
            int firstCourseGroupID = CourseGroupTestTable.InsertWithValues(
                "5s1cgndj6e5x0uvz",
                firstCourseScheduleID,
                1);

            // Insert the second master data rows in the database.
            int secondCourseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the second CourseGroup data row in the database.
            int secondCourseGroupID = CourseGroupTestTable.InsertWithValues(
                "78zcn25ynkaz50ef",
                secondCourseScheduleID,
                2);

            // Insert the third master data rows in the database.
            int thirdCourseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the third CourseGroup data row in the database.
            int thirdCourseGroupID = CourseGroupTestTable.InsertWithValues(
                "q5692qwy70qde9uv",
                thirdCourseScheduleID,
                3);

            // Build the database connection.
            CourseGroupDataRow[] courseGroupDataRows = null;
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Read the CourseGroup data rows.
                CourseGroupDataAccessComponent courseGroupDataAccessComponent = new CourseGroupDataAccessComponent();
                courseGroupDataRows = courseGroupDataAccessComponent.ReadByCourseScheduleID(databaseConnection, -1).Result;
            }

            // Validate the CourseGroup data rows.
            Assert.IsNotNull(courseGroupDataRows);
            Assert.AreEqual(0, courseGroupDataRows.Length);
        }
        public void Update_ShouldThrowException_GivenInvalidSessionID()
        {
            // Insert the first master data rows in the database.
            int firstSessionID = SessionTestTable.InsertPlaceholder();

            // Insert the second master data rows in the database.
            int secondSessionID = SessionTestTable.InsertPlaceholder();

            // Insert the CourseSchedule data row in the database.
            int courseScheduleID = CourseScheduleTestTable.InsertWithValues(
                "zzcj32kpd6huzp1n",
                firstSessionID,
                1,
                new TimeSpan(9, 15, 0));

            // Build the CourseSchedule data row.
            CourseScheduleDataRow courseScheduleDataRow = new CourseScheduleDataRow();
            courseScheduleDataRow.CourseScheduleID = courseScheduleID;
            courseScheduleDataRow.CourseScheduleCode = "8zu96quwvk70ng1e";
            courseScheduleDataRow.SessionID = -1;
            courseScheduleDataRow.DayOfWeek = 2;
            courseScheduleDataRow.Time = new TimeSpan(10, 30, 0);

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                try
                {
                    // Update the CourseSchedule data row.
                    CourseScheduleDataAccessComponent courseScheduleDataAccessComponent = new CourseScheduleDataAccessComponent();
                    courseScheduleDataAccessComponent.Update(databaseConnection, courseScheduleDataRow).Wait();

                    // Validate an exception was thrown.
                    Assert.Fail();
                }
                catch (AggregateException ex)
                {
                    // Validate an SQL exception was thrown.
                    Assert.IsInstanceOfType(ex.InnerExceptions[0], typeof(SqlException));
                }
            }
        }
        public void Create_ShouldThrowException_GivenDuplicateCourseScheduleCode()
        {
            // Insert the master data rows in the database.
            int sessionID = SessionTestTable.InsertPlaceholder();

            // Insert the duplicate CourseSchedule data row in the database.
            int courseScheduleID = CourseScheduleTestTable.InsertPlaceholder(courseScheduleCode: "zzcj32kpd6huzp1n");

            // Build the CourseSchedule data row.
            CourseScheduleDataRow courseScheduleDataRow = new CourseScheduleDataRow();
            courseScheduleDataRow.CourseScheduleCode = "zzcj32kpd6huzp1n";
            courseScheduleDataRow.SessionID = sessionID;
            courseScheduleDataRow.DayOfWeek = 1;
            courseScheduleDataRow.Time = new TimeSpan(9, 15, 0);

            // Build the database connection.
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                try
                {
                    // Create the CourseSchedule data row.
                    CourseScheduleDataAccessComponent courseScheduleDataAccessComponent = new CourseScheduleDataAccessComponent();
                    courseScheduleDataAccessComponent.Create(databaseConnection, courseScheduleDataRow).Wait();

                    // Validate an exception was thrown.
                    Assert.Fail();
                }
                catch (AggregateException ex)
                {
                    // Validate an SQL exception was thrown.
                    Assert.IsInstanceOfType(ex.InnerExceptions[0], typeof(SqlException));
                }
            }
        }
        public void ReadByCourseGroupID_ShouldReturnNull()
        {
            // Insert the master data rows in the database.
            int courseScheduleID = CourseScheduleTestTable.InsertPlaceholder();

            // Insert the CourseGroup data row in the database.
            int courseGroupID = CourseGroupTestTable.InsertWithValues(
                "5s1cgndj6e5x0uvz",
                courseScheduleID,
                1);

            // Build the database connection.
            CourseGroupDataRow courseGroupDataRow = null;
            using (DatabaseConnection databaseConnection = new DatabaseConnection(TestDatabase.ConnectionString))
            {
                // Open the database connection.
                databaseConnection.Open().Wait();

                // Read the CourseGroup data row.
                CourseGroupDataAccessComponent courseGroupDataAccessComponent = new CourseGroupDataAccessComponent();
                courseGroupDataRow = courseGroupDataAccessComponent.ReadByCourseGroupID(databaseConnection, -1).Result;
            }

            // Validate the CourseGroup data row.
            Assert.IsNull(courseGroupDataRow);
        }