private void CheckConsistency(ProducerAssociation _item) { Assert.AreEqual(HandlerState.Operational, _item.State.State); Assert.AreEqual <Guid>(AssociationConfigurationId, _item.DataDescriptor.Guid); Assert.AreEqual <string>(AssociationConfigurationInformationModelURI, _item.DataDescriptor.Identifier.ToString()); Assert.AreEqual <string>(AssociationConfigurationDataSymbolicName, _item.DataDescriptor.SymbolicName); }
public void AddMessageWriterTestMethod() { ProducerAssociation _npa = new ProducerAssociation (new SemanticData(), "DataManagement_ProducerAssociation", PersistentConfiguration.GetAssociationConfiguration(), new BindingFactory(Repository), new EncodingFactory()); Assert.IsNotNull(_npa); Assert.IsTrue(Repository.Count > 0); _npa.AddMessageWriter(null); }
public void ProducerAssociationCreatorTestMethod() { using (ProducerAssociation _npa = new ProducerAssociation( new SemanticData(), "DataManagement_ProducerAssociation", PersistentConfiguration.GetAssociationConfiguration(), new BindingFactory(Repository), new EncodingFactory()) ) { Assert.IsNotNull(_npa); Assert.IsTrue(Repository.Count > 0); ProducerBindingMonitoredValue <object>[] _values = Repository.Values.Cast <ProducerBindingMonitoredValue <object> >().ToArray <ProducerBindingMonitoredValue <object> >(); Assert.IsTrue(_values.Length > 0); _values[0].MonitoredValue = "1234567"; MessageWriter _mw = new MessageWriter(); _npa.AddMessageWriter(_mw); System.Threading.Thread.Sleep(1200); Assert.AreEqual <int>(1, _mw.IsOk); System.Threading.Thread.Sleep(1200); Assert.AreEqual <int>(1, _mw.IsOk); } }
public void ProducerAssociationCreatorTestMethod() { using (ProducerAssociation _npa = new ProducerAssociation( new SemanticData(), "DataManagement_ProducerAssociation", PersistentConfiguration.GetAssociationConfiguration(), new BindingFactory(Repository), new EncodingFactory()) ) { Assert.IsNotNull(_npa); Assert.IsTrue(Repository.Count > 0); ProducerBindingMonitoredValue<object>[] _values = Repository.Values.Cast<ProducerBindingMonitoredValue<object>>().ToArray<ProducerBindingMonitoredValue<object>>(); Assert.IsTrue(_values.Length > 0); _values[0].MonitoredValue = "1234567"; MessageWriter _mw = new MessageWriter(); _npa.AddMessageWriter(_mw); System.Threading.Thread.Sleep(1200); Assert.AreEqual<int>(1, _mw.IsOk); System.Threading.Thread.Sleep(1200); Assert.AreEqual<int>(1, _mw.IsOk); } }
private void CheckConsistency(ProducerAssociation _item) { Assert.AreEqual(HandlerState.Operational, _item.State.State); Assert.AreEqual<Guid>(AssociationConfigurationId, _item.DataDescriptor.Guid); Assert.AreEqual<string>(AssociationConfigurationInformationModelURI, _item.DataDescriptor.Identifier.ToString()); Assert.AreEqual<string>(AssociationConfigurationDataSymbolicName, _item.DataDescriptor.SymbolicName); }