private void SetVirtualReference() { if (!(TV_VirtualChannels.SelectedNode == null)) { if (TV_VirtualChannels.SelectedNode.Tag.ToString() == "Channel") { VirtualParameter sReference = new VirtualParameter(); sReference.LibraryName = TV_VirtualChannels.SelectedNode.Parent.Text; sReference.ChannelName = TV_VirtualChannels.SelectedNode.Text; CS_VirtualChannel oVirtual = oVCLibCollection.GetVirtualChannel(sReference.LibraryName, sReference.ChannelName); FrmCaller.SetVirtualChannelReference(sReference, oVirtual); this.Close(); } else { MessageBox.Show("You current selection is a library not a virtual channel !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("You must select a virtual channel !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void Not_supported_features() { IParameter testing = new VirtualParameter(owner); Assert.AreEqual(0, testing.GetCustomAttributes().Length); Assert.IsFalse(testing.IsOptional); Assert.IsFalse(testing.HasDefaultValue); Assert.IsNull(testing.DefaultValue); }
public void Parent_type_is_owner_s_parent_type() { var parentTypeMock = new Mock <IType>(); ownerMock.Setup(o => o.ParentType).Returns(parentTypeMock.Object); IParameter testing = new VirtualParameter(owner); Assert.AreSame(parentTypeMock.Object, testing.ParentType); }
public void Index_is_optional() { IParameter testing = new VirtualParameter(owner) .Index.Set(2) ; Assert.AreEqual(2, testing.Index); testing = new VirtualParameter(owner); Assert.AreEqual(0, testing.Index); }
public void Name_is_required() { IParameter testing = new VirtualParameter(owner) .Name.Set("virtual") ; Assert.AreEqual("virtual", testing.Name); testing = new VirtualParameter(owner); Assert.Throws <ConfigurationException>(() => { var dummy = testing.Name; }); }
public void ParameterType_is_required() { var parameterTypeMock = new Mock <IType>(); IParameter testing = new VirtualParameter(owner) .ParameterType.Set(parameterTypeMock.Object) ; Assert.AreSame(parameterTypeMock.Object, testing.ParameterType); testing = new VirtualParameter(owner); Assert.Throws <ConfigurationException>(() => { var dummy = testing.ParameterType; }); }
public void Owner_is_what_is_given_as_owner() { IParameter testing = new VirtualParameter(owner); Assert.AreSame(owner, testing.Owner); }