public void Add_QC_Rule_Test()
        {
            IQualityCheckRepository repository = new QualityCheckRepository(testDBContext);

            QualityCheckColumnRule colRule = new QualityCheckColumnRule() { Description = "Column 4", ErrorMessage = "Col1 is required", HeaderName = "Col1", IsActive = true, IsRequired = true, Order = 1, QualityCheckColumnRuleId = 1, QualityCheckColumnTypeId = 1, QualityCheckId = 2, Range = "" };
            QualityCheck qcRule = new QualityCheck()
            {
                CreatedBy = 1,
                CreatedOn = DateTime.UtcNow,
                Description = "Added rule",
                EnforceOrder = true,
                FileQualityChecks = null,
                IsActive = true,
                IsVisibleToAll = true,
                ModifiedBy = 1,
                ModifiedOn = DateTime.UtcNow,
                Name = "Added rule",
                QualityCheckColumnRules = new List<QualityCheckColumnRule>() { colRule },
                QualityCheckId = 2
            };

            repository.AddQualityCheckRule(qcRule);
            testDBContext.Commit();

            var addedQcRule = repository.GetQualityCheckByID(2);

            Assert.IsNotNull(addedQcRule);

            Assert.AreEqual(addedQcRule.CreatedBy, qcRule.CreatedBy);
            Assert.AreEqual(addedQcRule.Description, qcRule.Description);
            Assert.AreEqual(addedQcRule.EnforceOrder, qcRule.EnforceOrder);
            Assert.AreEqual(addedQcRule.IsActive, qcRule.IsActive);
            Assert.AreEqual(addedQcRule.IsVisibleToAll, qcRule.IsVisibleToAll);
            Assert.AreEqual(addedQcRule.ModifiedBy, qcRule.ModifiedBy);
            Assert.AreEqual(addedQcRule.Name, qcRule.Name);
            Assert.AreEqual(addedQcRule.QualityCheckId, qcRule.QualityCheckId);
            Assert.AreEqual(addedQcRule.Name, qcRule.Name);

            Assert.IsNull(addedQcRule.FileQualityChecks);
            Assert.IsNotNull(addedQcRule.QualityCheckColumnRules);

            var selColRule = addedQcRule.QualityCheckColumnRules.Where(rul => rul.QualityCheckId == 2).FirstOrDefault();

            Assert.AreEqual(selColRule.Description, colRule.Description);
            Assert.AreEqual(selColRule.ErrorMessage, colRule.ErrorMessage);
            Assert.AreEqual(selColRule.HeaderName, colRule.HeaderName);
            Assert.AreEqual(selColRule.IsActive, colRule.IsActive);
            Assert.AreEqual(selColRule.IsRequired, colRule.IsRequired);
            Assert.AreEqual(selColRule.Order, colRule.Order);
            Assert.AreEqual(selColRule.QualityCheckColumnRuleId, colRule.QualityCheckColumnRuleId);
            Assert.AreEqual(selColRule.QualityCheckId, colRule.QualityCheckId);
            Assert.AreEqual(selColRule.Range, colRule.Range);
        }
        public void Throw_Exception_On_Add_Null_QCRule_Test()
        {
            IQualityCheckRepository repository = new QualityCheckRepository(testDBContext);

            repository.AddQualityCheckRule(null);
        }