Example #1
0
        public void GetElementInfo_AskForExistingElement_ReturnsInfoAboutElement(string id, string elementType, string taskType)
        {
            // Arrange
            string     definitions = LoadResourceAsString("Altinn.Process.UnitTest.TestData.default_process.bpmn");
            BpmnReader target      = BpmnReader.Create(definitions);

            // Act
            ElementInfo actual = target.GetElementInfo(id);

            // Assert
            Assert.NotNull(actual);
            Assert.Equal(id, actual.Id);
            Assert.Equal(elementType, actual.ElementType);
            Assert.Equal(taskType, actual.AltinnTaskType);
        }
Example #2
0
        public void GetElementInfo_AskForElementInfoForElementNull_ThrowsArgumentNullException()
        {
            // Arrange
            string     definitions = LoadResourceAsString("Altinn.Process.UnitTest.TestData.default_process.bpmn");
            BpmnReader target      = BpmnReader.Create(definitions);

            ArgumentNullException actual = null;

            // Act
            try
            {
                _ = target.GetElementInfo(null);
            }
            catch (ArgumentNullException ane)
            {
                actual = ane;
            }

            // Assert
            Assert.NotNull(actual);
            Assert.IsType <ArgumentNullException>(actual);
            Assert.Equal("elementId", actual.ParamName);
        }