Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 /// <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);
 }