public void FindObjectByPath_ShouldntFindPathInvalidPathException(Subsystem parent, IStructure obj, string path) { //Arrange //Act parent.AddChild(obj); //Assert Assert.Throws <InvalidPathException>(() => parent.FindObjectByPath(path)); }
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); }
public void FindObjectByPath_ShouldntFindPathToObjectWhenObjectHasParentWithValidWrongPath(Subsystem parent, IStructure obj, string path) { //Arrange //Act parent.AddChild(obj); IStructure result = parent.FindObjectByPath(path); //Assert Assert.Null(result); }
public void GetFullPath_ShouldReturnPathWhenHasParent(Subsystem parent, IStructure obj, string expectedPath) { //Arrange //Act parent.AddChild(obj); string pathResult = obj.GetFullPath(); //Assert Assert.Equal(expectedPath, pathResult); }