Beispiel #1
0
        public void EqualsUAVariableTestMethod()
        {
            UAVariable _derivedNode = new UAVariable()
            {
                NodeId       = "ns=1;i=47",
                BrowseName   = "EURange",
                ParentNodeId = "ns=1;i=43",
                DataType     = "i=884",
                DisplayName  = new XML.LocalizedText[] { new XML.LocalizedText()
                                                         {
                                                             Value = "EURange"
                                                         } }
            };
            UANode _baseNode = new UAVariable()
            {
                NodeId       = "i=17568",
                BrowseName   = "EURange",
                ParentNodeId = "i=15318",
                DataType     = "i=884",
                DisplayName  = new XML.LocalizedText[] { new XML.LocalizedText()
                                                         {
                                                             Value = "EURange"
                                                         } }
            };
            Mock <IAddressSpaceBuildContext> _asMock = new Mock <IAddressSpaceBuildContext>();
            IUANodeContext _derivedNodeContext       = new UANodeContext(NodeId.Parse("ns=1;i=47"), _asMock.Object);

            _derivedNodeContext.Update(_derivedNode, x => Assert.Fail());
            UANodeContext _baseNodeContext = new UANodeContext(NodeId.Parse("i=17568"), _asMock.Object);

            _baseNodeContext.Update(_baseNode, x => Assert.Fail());
            Assert.IsTrue(_derivedNode.Equals(_baseNode));
            Assert.IsTrue(_derivedNodeContext.Equals(_baseNodeContext));
        }
        public void EqualsTest()
        {
            IUAModelContext _mc     = new UAModelContext();
            UANodeContext   _first  = new UANodeContext(new AddressSpaceBuildContext(), _mc, NodeId.Parse("ns=1;i=11"));
            UANodeContext   _second = new UANodeContext(new AddressSpaceBuildContext(), _mc, NodeId.Parse("ns=1;i=11"));

            Assert.IsTrue(_first.Equals(_second));
        }
Beispiel #3
0
        public void EqualsTest()
        {
            AddressSpaceBuildContext _as     = new AddressSpaceBuildContext();
            UANodeContext            _first  = _as.InstanceToTest;
            UANodeContext            _second = _as.InstanceToTest;

            Assert.IsTrue(_first.Equals(_second));
        }