Example #1
0
        public void AdvancedPathSplitting()
        {
            const string path = "PLC.Modules.<Default>.OPCua_Axis:opc_Axis.StatusX.Homing";

            string firstElement;
            var    restOfPath = RemoteHelper.RestOfPath(path, out firstElement);

            Assert.IsTrue(firstElement == "PLC");
            Assert.IsTrue(restOfPath == "Modules.<Default>.OPCua_Axis:opc_Axis.StatusX.Homing");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "Modules");
            Assert.IsTrue(restOfPath == "<Default>.OPCua_Axis:opc_Axis.StatusX.Homing");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "<Default>");
            Assert.IsTrue(restOfPath == "OPCua_Axis:opc_Axis.StatusX.Homing");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "OPCua_Axis");
            Assert.IsTrue(restOfPath == "opc_Axis.StatusX.Homing");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "opc_Axis");
            Assert.IsTrue(restOfPath == "StatusX.Homing");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "StatusX");
            Assert.IsTrue(restOfPath == "Homing");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "Homing");
            Assert.IsTrue(restOfPath == "");
        }
Example #2
0
        public void PathSplitting()
        {
            const string path = "ServerConsole.BusinessLogic.JobStates";

            string firstElement;
            var    restOfPath = RemoteHelper.RestOfPath(path, out firstElement);

            Assert.IsTrue(firstElement == "ServerConsole");
            Assert.IsTrue(restOfPath == "BusinessLogic.JobStates");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "BusinessLogic");
            Assert.IsTrue(restOfPath == "JobStates");

            restOfPath = RemoteHelper.RestOfPath(restOfPath, out firstElement);
            Assert.IsTrue(firstElement == "JobStates");
            Assert.IsTrue(restOfPath == "");
        }