public void GetErrorTest() { // Arrange IRucmRuleValidator testrucmRuleValidator = new RucmRuleValidator(RucmRuleRepository.Rules); XmlStructureParser testxmlStructureParser = new XmlStructureParser(testrucmRuleValidator); string result = string.Empty; // Act result = testxmlStructureParser.GetError(); // Assert Assert.IsEmpty(result); }
public void LoadXmlFileTestWithBrokenXmlSampleFile() { // Arrange IRucmRuleValidator testrucmRuleValidator = new RucmRuleValidator(RucmRuleRepository.Rules); XmlStructureParser testxmlStructureParser = new XmlStructureParser(testrucmRuleValidator); string filePath = "UseCaseTest\\XmlParser\\Testdateien\\UseCaseBeispiel - XML-Struktur defekt.docx"; bool result = false; // Act result = testxmlStructureParser.LoadXmlFile(filePath); // Assert Assert.IsFalse(result); }
public void ParseXmlFileTestWithRucmValidationRule19_23_24_25_26FailedSampleFile() { // Arrange IRucmRuleValidator testrucmRuleValidator = new RucmRuleValidator(RucmRuleRepository.Rules); XmlStructureParser testxmlStructureParser = new XmlStructureParser(testrucmRuleValidator); string filePath = "UseCaseTest\\XmlParser\\Testdateien\\UseCaseBeispiel - Regel 19, 23, 24, 25 und 26 verletzt.docx"; UseCase testUseCase = new UseCase(); bool resultLoadXmlFile = false; bool resultParseXmlFile = false; // Act resultLoadXmlFile = testxmlStructureParser.LoadXmlFile(filePath); resultParseXmlFile = testxmlStructureParser.ParseXmlFile(out testUseCase); // Assert Assert.IsTrue(resultLoadXmlFile); Assert.IsFalse(resultParseXmlFile); Assert.IsNull(testUseCase); }
public void ParseXmlFileTestWithWorstCaseSampleFile() { // Arrange IRucmRuleValidator testrucmRuleValidator = new RucmRuleValidator(RucmRuleRepository.Rules); XmlStructureParser testxmlStructureParser = new XmlStructureParser(testrucmRuleValidator); string filePath = "UseCaseTest\\XmlParser\\Testdateien\\UseCaseBeispiel - Worst-Case Szenario.docx"; UseCase testUseCase = new UseCase(); bool resultLoadXmlFile = false; bool resultParseXmlFile = false; // Act resultLoadXmlFile = testxmlStructureParser.LoadXmlFile(filePath); resultParseXmlFile = testxmlStructureParser.ParseXmlFile(out testUseCase); // Assert Assert.IsTrue(resultLoadXmlFile); Assert.IsTrue(resultParseXmlFile); Assert.IsNotNull(testUseCase); }
public void ParseXmlFileTestWithOneRfsBoundedAlternativeFlowSampleFile() { // Arrange IRucmRuleValidator testrucmRuleValidator = new RucmRuleValidator(RucmRuleRepository.Rules); XmlStructureParser testxmlStructureParser = new XmlStructureParser(testrucmRuleValidator); string filePath = "UseCaseTest\\XmlParser\\Testdateien\\UseCaseBeispiel - BoundedAlternativeFlow mit einem RFS.docx"; UseCase testUseCase = new UseCase(); bool resultLoadXmlFile = false; bool resultParseXmlFile = false; // Act resultLoadXmlFile = testxmlStructureParser.LoadXmlFile(filePath); resultParseXmlFile = testxmlStructureParser.ParseXmlFile(out testUseCase); // Assert Assert.IsTrue(resultLoadXmlFile); Assert.IsTrue(resultParseXmlFile); Assert.IsNotNull(testUseCase); }
public void ParseXmlFileTestWithCorrectXmlSampleFileButWithFormattingChanges() { // Arrange IRucmRuleValidator testrucmRuleValidator = new RucmRuleValidator(RucmRuleRepository.Rules); XmlStructureParser testxmlStructureParser = new XmlStructureParser(testrucmRuleValidator); string filePath = "UseCaseTest\\XmlParser\\Testdateien\\UseCaseBeispiel - Keine Fehler aber mit Formatierungsänderungen.docx"; UseCase testUseCase = new UseCase(); bool resultLoadXmlFile = false; bool resultParseXmlFile = false; // Act resultLoadXmlFile = testxmlStructureParser.LoadXmlFile(filePath); resultParseXmlFile = testxmlStructureParser.ParseXmlFile(out testUseCase); // Assert Assert.IsTrue(resultLoadXmlFile); Assert.IsTrue(resultParseXmlFile); Assert.IsNotNull(testUseCase); }
/// <summary> /// Initializes a new instance of the <see cref="Controller"/> class. /// </summary> public Controller() { this.ruleValidator = new RucmRuleValidator(RucmRuleRepository.Rules); this.xmlParser = new XmlStructureParser(this.ruleValidator); }