Esempio n. 1
0
 public void DeleteLogAudit(LogGradeSpecies sp, LogGradeAuditRule value)
 {
     if (sp.Remove(value))
     {
         DeletedLogGradeAuditRules.Add(value);
     }
 }
Esempio n. 2
0
        public LogGradeAuditRule MakeLogGradeAudit()
        {
            var newLogAudit = new LogGradeAuditRule()
            {
                DAL = Database
            };

            return(newLogAudit);
        }
Esempio n. 3
0
        public void GradesTest()
        {
            var lga = new LogGradeAuditRule()
            {
                ValidGrades = "0,1, 2 , 3"
            };

            lga.Grades.Should().Contain(new string[] { "0", "1", "2", "3" });
        }
Esempio n. 4
0
        public void ValidateLogGradeTest()
        {
            var log = new Log();

            IEnumerable <LogGradeAuditRule> audits = null;

            //Action callingValidateWithNullAuditCollection = () => ILogDataService.ValidateLogGrade(log, audits);
            //callingValidateWithNullAuditCollection.ShouldNotThrow();
            ILogDataService.ValidateLogGrade(log, audits).Should().BeTrue();

            audits = new LogGradeAuditRule[] { };
            ILogDataService.ValidateLogGrade(log, audits).Should().BeTrue();

            audits = new LogGradeAuditRule[] { new LogGradeAuditRule() };
            ILogDataService.ValidateLogGrade(log, audits).Should().BeTrue();

            audits = new LogGradeAuditRule[] { new LogGradeAuditRule()
                                               {
                                                   ValidGrades = ""
                                               } };
            ILogDataService.ValidateLogGrade(log, audits).Should().BeTrue();

            log.Grade = "0 ";
            audits    = new LogGradeAuditRule[] { new LogGradeAuditRule()
                                                  {
                                                      ValidGrades = "0"
                                                  } };
            ILogDataService.ValidateLogGrade(log, audits).Should().BeTrue();

            log.Grade = "0 ";
            audits    = new LogGradeAuditRule[] { new LogGradeAuditRule()
                                                  {
                                                      ValidGrades = "1"
                                                  } };
            ILogDataService.ValidateLogGrade(log, audits).Should().BeFalse();
            log[nameof(log.Grade)].Should().NotBeNullOrEmpty();
        }