Beispiel #1
0
        public void FindObjectByPath_ShouldntFindPathInvalidPathException(Subsystem parent, IStructure obj, string path)
        {
            //Arrange

            //Act
            parent.AddChild(obj);

            //Assert
            Assert.Throws <InvalidPathException>(() => parent.FindObjectByPath(path));
        }
Beispiel #2
0
        public void FindObjectByPath_ShouldFindPathToObjectWhenItHasParent(Subsystem parent, IStructure obj, string path)
        {
            //Arrange

            //Act
            parent.AddChild(obj);
            IStructure result = parent.FindObjectByPath(path);

            //Assert
            Assert.Equal <IStructure>(obj, result);
        }
Beispiel #3
0
        public void FindObjectByPath_ShouldntFindPathToObjectWhenObjectHasParentWithValidWrongPath(Subsystem parent, IStructure obj, string path)
        {
            //Arrange

            //Act
            parent.AddChild(obj);
            IStructure result = parent.FindObjectByPath(path);

            //Assert
            Assert.Null(result);
        }
Beispiel #4
0
        public void GetFullPath_ShouldReturnPathWhenHasParent(Subsystem parent, IStructure obj, string expectedPath)
        {
            //Arrange

            //Act
            parent.AddChild(obj);
            string pathResult = obj.GetFullPath();

            //Assert
            Assert.Equal(expectedPath, pathResult);
        }