Пример #1
0
 public void AssociationInitializeMethod()
 {
     ISemanticData _testISemanticData = new TestISemanticData();
       Assert.IsNotNull(_testISemanticData);
       TestAssociation _nt = new TestAssociation(_testISemanticData, "AssociationInitializeMethod");
       Assert.IsNotNull(_nt);
       int _eventsCount = 0;
       HandlerState _lastState = default(HandlerState);
       _nt.StateChangedEventHandler += (x, y) => { _eventsCount++; _lastState = y.State; };
       Assert.AreEqual<HandlerState>(HandlerState.NoConfiguration, _nt.State.State);
       Assert.AreEqual<int>(0, _eventsCount);
       _nt.Initialize();
       Assert.AreEqual<int>(1, _eventsCount);
       Assert.IsNotNull(_lastState);
       Assert.AreEqual<HandlerState>(HandlerState.Disabled, _lastState);
       Assert.AreEqual<HandlerState>(HandlerState.Disabled, _nt.State.State);
       _nt.State.Enable();
       Assert.AreEqual<int>(2, _eventsCount);
       Assert.IsNotNull(_lastState);
       Assert.AreEqual<HandlerState>(HandlerState.Operational, _lastState);
       Assert.AreEqual<HandlerState>(HandlerState.Operational, _nt.State.State);
       _nt.State.Disable();
       Assert.AreEqual<int>(3, _eventsCount);
       Assert.IsNotNull(_lastState);
       Assert.AreEqual<HandlerState>(HandlerState.Disabled, _lastState);
       Assert.AreEqual<HandlerState>(HandlerState.Disabled, _nt.State.State);
 }
Пример #2
0
        public void AssociationCreatorTestMethod2()
        {
            ISemanticData _testISemanticData = new TestISemanticData();

            Assert.IsNotNull(_testISemanticData);
            TestAssociation _nt = new TestAssociation(_testISemanticData, null);
        }
Пример #3
0
        public void AssociationInitializeMethod()
        {
            ISemanticData _testISemanticData = new TestISemanticData();

            Assert.IsNotNull(_testISemanticData);
            TestAssociation _nt = new TestAssociation(_testISemanticData, "AssociationInitializeMethod");

            Assert.IsNotNull(_nt);
            int          _eventsCount = 0;
            HandlerState _lastState   = default(HandlerState);

            _nt.StateChangedEventHandler += (x, y) => { _eventsCount++; _lastState = y.State; };
            Assert.AreEqual <HandlerState>(HandlerState.NoConfiguration, _nt.State.State);
            Assert.AreEqual <int>(0, _eventsCount);
            _nt.Initialize();
            Assert.AreEqual <int>(1, _eventsCount);
            Assert.IsNotNull(_lastState);
            Assert.AreEqual <HandlerState>(HandlerState.Disabled, _lastState);
            Assert.AreEqual <HandlerState>(HandlerState.Disabled, _nt.State.State);
            _nt.State.Enable();
            Assert.AreEqual <int>(2, _eventsCount);
            Assert.IsNotNull(_lastState);
            Assert.AreEqual <HandlerState>(HandlerState.Operational, _lastState);
            Assert.AreEqual <HandlerState>(HandlerState.Operational, _nt.State.State);
            _nt.State.Disable();
            Assert.AreEqual <int>(3, _eventsCount);
            Assert.IsNotNull(_lastState);
            Assert.AreEqual <HandlerState>(HandlerState.Disabled, _lastState);
            Assert.AreEqual <HandlerState>(HandlerState.Disabled, _nt.State.State);
        }
Пример #4
0
        public void AssociationStateEnableTestMethod()
        {
            ISemanticData _testISemanticData = new TestISemanticData();

            Assert.IsNotNull(_testISemanticData);
            TestAssociation _nt = new TestAssociation(_testISemanticData, "AssociationStateEnableTestMethod");

            Assert.IsNotNull(_nt);
            _nt.State.Enable();
        }
Пример #5
0
 public void AssociationCreatorTestMethod4()
 {
     string _alias = "AssociationCreatorTestMethod4";
       ISemanticData _testISemanticData = new TestISemanticData();
       Assert.IsNotNull(_testISemanticData);
       TestAssociation _nt = new TestAssociation(_testISemanticData, _alias);
       Assert.IsNotNull(_nt);
       Assert.IsNotNull(_nt.DataDescriptor);
       Assert.IsNotNull(_nt.DataDescriptor.Identifier);
       Assert.IsNotNull(_nt.State);
       Assert.AreNotEqual<Guid>(Guid.Empty, _nt.Id);
       Assert.AreEqual<HandlerState>(HandlerState.NoConfiguration, _nt.State.State);
       Assert.AreEqual<string>(_alias, _nt.ToString());
 }
Пример #6
0
 public void AssociationCompareToTestMethod()
 {
     ISemanticData _testISemanticData0 = new TestISemanticData("TestISemanticData1", 0, Guid.Parse(@"{9912B722-304D-438F-8538-3C6F98068E66}"));
       Assert.IsNotNull(_testISemanticData0);
       TestAssociation _nt0 = new TestAssociation(_testISemanticData0, "AssociationCompareToTestMethod0");
       Assert.IsNotNull(_nt0);
       Assert.AreEqual<int>(0, _nt0.CompareTo(_nt0));
       ISemanticData _testISemanticData1 = new TestISemanticData("TestISemanticData0", 0, Guid.Parse(@"{9912B722-304D-438F-8538-3C6F98068E65}"));
       Assert.IsNotNull(_testISemanticData1);
       TestAssociation _nt1 = new TestAssociation(_testISemanticData1, "AssociationCompareToTestMethod1");
       Assert.IsNotNull(_nt1);
       Assert.AreEqual<int>(-1, _nt1.CompareTo(_nt0));
       Assert.AreEqual<int>(1, _nt0.CompareTo(_nt1));
 }
Пример #7
0
        public void AssociationCreatorTestMethod4()
        {
            string        _alias             = "AssociationCreatorTestMethod4";
            ISemanticData _testISemanticData = new TestISemanticData();

            Assert.IsNotNull(_testISemanticData);
            TestAssociation _nt = new TestAssociation(_testISemanticData, _alias);

            Assert.IsNotNull(_nt);
            Assert.IsNotNull(_nt.DataDescriptor);
            Assert.IsNotNull(_nt.DataDescriptor.Identifier);
            Assert.IsNotNull(_nt.State);
            Assert.AreNotEqual <Guid>(Guid.Empty, _nt.Id);
            Assert.AreEqual <HandlerState>(HandlerState.NoConfiguration, _nt.State.State);
            Assert.AreEqual <string>(_alias, _nt.ToString());
        }
Пример #8
0
        public void AssociationCompareToTestMethod()
        {
            ISemanticData _testISemanticData0 = new TestISemanticData("TestISemanticData1", 0, Guid.Parse(@"{9912B722-304D-438F-8538-3C6F98068E66}"));

            Assert.IsNotNull(_testISemanticData0);
            TestAssociation _nt0 = new TestAssociation(_testISemanticData0, "AssociationCompareToTestMethod0");

            Assert.IsNotNull(_nt0);
            Assert.AreEqual <int>(0, _nt0.CompareTo(_nt0));
            ISemanticData _testISemanticData1 = new TestISemanticData("TestISemanticData0", 0, Guid.Parse(@"{9912B722-304D-438F-8538-3C6F98068E65}"));

            Assert.IsNotNull(_testISemanticData1);
            TestAssociation _nt1 = new TestAssociation(_testISemanticData1, "AssociationCompareToTestMethod1");

            Assert.IsNotNull(_nt1);
            Assert.AreEqual <int>(-1, _nt1.CompareTo(_nt0));
            Assert.AreEqual <int>(1, _nt0.CompareTo(_nt1));
        }
Пример #9
0
 public void AssociationCreatorTestMethod1()
 {
     TestAssociation _nt = new TestAssociation(null, null);
 }
Пример #10
0
 public void AssociationCreatorTestMethod2()
 {
     ISemanticData _testISemanticData = new TestISemanticData();
       Assert.IsNotNull(_testISemanticData);
       TestAssociation _nt = new TestAssociation(_testISemanticData, null);
 }
Пример #11
0
 public void AssociationCreatorTestMethod1()
 {
     TestAssociation _nt = new TestAssociation(null, null);
 }
Пример #12
0
 public void AssociationStateEnableTestMethod()
 {
     ISemanticData _testISemanticData = new TestISemanticData();
       Assert.IsNotNull(_testISemanticData);
       TestAssociation _nt = new TestAssociation(_testISemanticData, "AssociationStateEnableTestMethod");
       Assert.IsNotNull(_nt);
       _nt.State.Enable();
 }