How to mock up an event?

42 views
Skip to first unread message

Hui Zhao

unread,
Dec 9, 2015, 9:11:26 AM12/9/15
to Moq Discussions
I have the code.
private void s_TelephonyServer_NewCall(object sender, NewCallEventArgs e)
        {
            // Handle The New Call Here
            var inboundLine = new VoiceElementsLine
            {
                TelephonyServer = TelephonyServer,
                ChannelResource = e.ChannelResource
            };
            var callInfo = new VoiceElementsCallInfo {InboundLine = inboundLine };
            inboundLine.LineId = callInfo.CallId;
            lock (VoiceElementsCallFlowService.SyncVar)
            {
                Calls.Add(callInfo);
            }
            inboundLine.SetupLine();
            inboundLine.RunCallScript();
        }
And
public virtual void RegisterTelephonyServerNewCallEvent()
        {
            TelephonyServer.NewCall += s_TelephonyServer_NewCall;
        }

I am not sure how to deal with that. Code help please. Thanks. 
 
 

Arno Brouwer

unread,
Dec 9, 2015, 11:12:16 AM12/9/15
to Moq Discussions
What is it that you want to test?

Ale Miralles

unread,
Dec 9, 2015, 12:20:53 PM12/9/15
to moq...@googlegroups.com
I was going to ask the same.

On 9 December 2015 at 13:12, Arno Brouwer <tallde...@gmail.com> wrote:
What is it that you want to test?

--
--
Post: moq...@googlegroups.com
Unsubscribe: moqdisc-u...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Moq Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moqdisc+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages