示例#1
0
 public void CommServerConfigurationMainCreatorTest()
 {
     using (CommServerConfigurationMain _new = new CommServerConfigurationMain())
     {
         using (ComunicationNet _defaultCommunicationNet = _new.Configuartion)
         {
             Assert.IsNotNull(_defaultCommunicationNet);
             Assert.IsNotNull(_defaultCommunicationNet.Channels);
             Assert.IsNotNull(_defaultCommunicationNet.DataBlocks);
             Assert.IsNotNull(_defaultCommunicationNet.Groups);
             Assert.IsNotNull(_defaultCommunicationNet.Interfaces);
             Assert.IsNotNull(_defaultCommunicationNet.ItemPropertiesTable);
             Assert.IsNotNull(_defaultCommunicationNet.Protocol);
             Assert.IsNotNull(_defaultCommunicationNet.Relations);
             Assert.IsNotNull(_defaultCommunicationNet.Relations);
             Assert.IsNotNull(_defaultCommunicationNet.Segments);
             Assert.IsNotNull(_defaultCommunicationNet.SerialSetings);
             Assert.IsNotNull(_defaultCommunicationNet.Station);
             Assert.IsNotNull(_defaultCommunicationNet.TagBit);
             Assert.IsNotNull(_defaultCommunicationNet.Tags);
         }
         Assert.IsNull(_new.Container);
         Assert.AreEqual <string>(@"CommServerConfiguration", _new.DefaultFileName);
         Assert.IsNotNull(_new.Menu);
         Assert.IsNotNull(_new.OpenFileDialog);
     }
 }
示例#2
0
        public void ConstructorTest()
        {
            CommServerConfigurationMain _new = null;

            using (IContainer _components = new Container())
            {
                Assert.IsNotNull(_components.Components);
                Assert.AreEqual <int>(0, _components.Components.Count);
                _new = new CommServerConfigurationMain(_components);
                Assert.AreEqual <int>(1, _components.Components.Count);
                Assert.AreEqual <int>(1, _new.Container.Components.Count);
                Assert.AreSame(_components.Components[0], _new.Container.Components[0]);
                Assert.IsNotNull(_new.OpenFileDialog);
                Assert.IsNotNull(_new.Configuartion);
                Assert.AreEqual <string>(@"CommServerConfiguration", _new.DefaultFileName);
            }
            Assert.IsNull(_new.OpenFileDialog);
            Assert.IsNull(_new.Configuartion);
        }