コード例 #1
0
        public void CreatorTestMethod()
        {
            NodeDescriptorBase _new = NodeDescriptor.GetTestInstance();

            Assert.IsNotNull(_new);
            Assert.IsNotNull(_new.NodeIdentifier);
        }
コード例 #2
0
        public void IEqualityComparerTestMethod()
        {
            NodeDescriptorBase _new = NodeDescriptor.GetTestInstance();

            Assert.IsNotNull(_new);
            Assert.IsNotNull(_new.NodeIdentifier);
            NodeDescriptorBase _other = NodeDescriptor.GetTestInstance();

            Assert.IsNotNull(_new);
            Assert.IsNotNull(_new.NodeIdentifier);
            Assert.AreEqual <int>(_new.GetHashCode(_new), _other.GetHashCode(_other));
            Assert.AreEqual <NodeDescriptorBase>(_new, _other);
        }
コード例 #3
0
        public void IComparerTestMethod()
        {
            NodeDescriptorBase _new = NodeDescriptor.GetTestInstance();

            Assert.IsNotNull(_new);
            Assert.IsNotNull(_new.NodeIdentifier);
            NodeDescriptorBase _Other = NodeDescriptor.GetTestInstance();

            Assert.IsNotNull(_new);
            Assert.IsNotNull(_new.NodeIdentifier);
            Assert.AreEqual <int>(0, _new.CompareTo(_Other));
            Assert.AreEqual <NodeDescriptorBase>(_new, _Other);
        }
        public void GetInstanceConfigurationNoConfigurationTestMethod()
        {
            UANetworkingConfigurationEditor _newConfiguration = new UANetworkingConfigurationEditor();

            Assert.IsNotNull(_newConfiguration);
            NodeDescriptor         _nd = NodeDescriptor.GetTestInstance();
            IInstanceConfiguration _newInstanceConfiguration = _newConfiguration.GetInstanceConfiguration(_nd);

            Assert.IsNotNull(_newInstanceConfiguration);
            IInstanceConfiguration _nxtInstanceConfiguration = _newConfiguration.GetInstanceConfiguration(_nd);

            Assert.AreNotSame(_newInstanceConfiguration, _nxtInstanceConfiguration);
            Assert.AreEqual <string>(_newInstanceConfiguration.ToString(), _nxtInstanceConfiguration.ToString());
        }
コード例 #5
0
        public void GetInstanceConfigurationNoConfigurationTestMethod()
        {
            Container _container = new Container();

            ServiceLocator.SetLocatorProvider(() => _container);
            UANetworkingConfigurationEditor _newConfiguration = new UANetworkingConfigurationEditor();

            Assert.IsNotNull(_newConfiguration);
            NodeDescriptor         _nd = NodeDescriptor.GetTestInstance();
            IInstanceConfiguration _newInstanceConfiguration = _newConfiguration.GetInstanceConfiguration(_nd);

            Assert.IsNotNull(_newInstanceConfiguration);
            IInstanceConfiguration _nxtInstanceConfiguration = _newConfiguration.GetInstanceConfiguration(_nd);

            Assert.AreNotSame(_newInstanceConfiguration, _nxtInstanceConfiguration);
            Assert.AreEqual <string>(_newInstanceConfiguration.ToString(), _nxtInstanceConfiguration.ToString());
        }
コード例 #6
0
        public void DictionaryTestMethod()
        {
            NodeDescriptorBase _new = NodeDescriptor.GetTestInstance();

            Assert.IsNotNull(_new);
            Assert.IsNotNull(_new.NodeIdentifier);
            NodeDescriptorBase _Other = NodeDescriptor.GetTestInstance();

            Assert.IsNotNull(_new);
            Assert.IsNotNull(_new.NodeIdentifier);
            Assert.AreEqual <int>(0, _new.CompareTo(_Other));
            Assert.AreEqual <NodeDescriptorBase>(_new, _Other);
            Dictionary <NodeDescriptorBase, NodeDescriptorBase> _newDic = new Dictionary <NodeDescriptorBase, NodeDescriptorBase>();

            _newDic.Add(_new, _new);
            Assert.IsTrue(_newDic.ContainsKey(_new));
            Assert.IsTrue(_newDic.ContainsKey(_Other));
            _newDic.Add(_new, _Other);
        }