public void NullValueShouldThrowError() { // Arrange string input = null; CheckFile checkFile = new CheckFile(); // Act checkFile.ExtractDuur(input); }
public void ValidInputTextExtractsValidCode() { //Arrange string inputText = "Duur: 5 dagen"; int expected = 5; CheckFile checkFile = new CheckFile(); //Act int actual = checkFile.ExtractDuur(inputText); // Assert Assert.IsTrue(actual == expected); }
private async Task CheckParagraph(string paragraph) { CheckFile cf = new CheckFile(); string[] line = paragraph.Split("\n"); //check of Cursus al bestaat if (!_context.cursussen.Any(e => e.CursusCode.Equals(cf.ExtractCode(line[1])))) { Cursus cursus = new Cursus(cf.ExtractTitle(line[0]), cf.ExtractCode(line[1]), cf.ExtractDuur(line[2])); await addCursus(cursus); } else { int id = _context.cursussen.SingleOrDefault(c => c.CursusCode == cf.ExtractCode(line[1])).Id; DateTime startDatum = cf.ExtractStartDatum(line[3]); Cursusinstantie cursusinstantie = new Cursusinstantie(id, startDatum); await addCursusInstantie(cursusinstantie); } }