public void DeleteLogAudit(LogGradeSpecies sp, LogGradeAuditRule value) { if (sp.Remove(value)) { DeletedLogGradeAuditRules.Add(value); } }
public LogGradeAuditRule MakeLogGradeAudit() { var newLogAudit = new LogGradeAuditRule() { DAL = Database }; return(newLogAudit); }
public void GradesTest() { var lga = new LogGradeAuditRule() { ValidGrades = "0,1, 2 , 3" }; lga.Grades.Should().Contain(new string[] { "0", "1", "2", "3" }); }
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(); }