Пример #1
0
        public void AddDuplicateChannelInEventExecutor()
        {
            AMSEventSqlAdapter.Instance.ClearAll();
            AMSChannelSqlAdapter.Instance.ClearAll();

            AMSChannel channel = DataHelper.PrepareChannelData();
            AMSChannelSqlAdapter.Instance.Update(channel);

            AMSEvent eventData = DataHelper.PrepareEventData(channel.ID);

            AMSEventSqlAdapter.Instance.Update(eventData);

            AMSChannel newChannel = DataHelper.PrepareChannelData();
            newChannel.ID = channel.ID;
            AMSChannelSqlAdapter.Instance.Update(newChannel);

            AMSAddChannelInEventExecutor executor = new AMSAddChannelInEventExecutor(eventData.ID, newChannel.ID);

            executor.Execute();

            AMSChannelCollection channels = AMSEventSqlAdapter.Instance.LoadRelativeChannels(eventData.ID);

            channels.Output();
            Assert.AreEqual(2, channels.Count);
        }
Пример #2
0
        protected void postAddChannelBtn_Click(object sender, EventArgs e)
        {
            string channelID = this.unusedChannels.SelectedValue;

            if (channelID.IsNotEmpty())
            {
                AMSAddChannelInEventExecutor executor = new AMSAddChannelInEventExecutor(this.EventID, channelID);

                executor.Execute();

                this.RefreshChannelsAndList();
            }
        }