protected override void Given()
 {
     base.Given();
     var response = new SipResponseBuilder().WithCallId(null).Build();
     _packet = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().WithText(response.FormatEnvelopeToString()).Build()).Build();
     _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
 }
コード例 #2
0
        protected override void Given()
        {
            base.Given();
            var response = new SipResponseBuilder().WithCallId(null).Build();

            _packet  = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().WithText(response.FormatEnvelopeToString()).Build()).Build();
            _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
        }
コード例 #3
0
        protected override void Given()
        {
            base.Given();
            var parser = new Mock<ISipMessageParser>();
            parser.Setup(p => p.ParseSipMessage(It.IsAny<byte[]>(), It.IsAny<string>())).Throws(new SipParseException(""));

            _validator = new Mock<ISipValidator>();
            _packet = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().WithText("nonsens").Build()).Build();
            _channel = new UdpMessageChannel( new SipStack(), _validator.Object, parser.Object);
        }
コード例 #4
0
        protected override void Given()
        {
            base.Given();

            _remoteEndPoint = TestConstants.IpEndPoint1;
            var response = new SipResponseBuilder().Build();
            var bytes = new DataBytesBuilder().WithText(response.FormatEnvelopeToString()).Build();
            _packet = new UdpPacketBuilder().WithDataBytes(bytes).WithRemoteEp(_remoteEndPoint).Build();
            _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
        }
 protected override void Given()
 {
     base.Given();
     _senderEndPoint = TestConstants.IpEndPoint1;
     var via = new SipViaHeaderBuilder().WithSentBy(_senderEndPoint).Build();
     var request = new SipRequestBuilder().WithVias(new SipViaHeaderListBuilder().Add(via).Build()).Build();
     var bytes = new DataBytesBuilder().WithText(request.FormatEnvelopeToString()).Build();
     _packet = new UdpPacketBuilder().WithDataBytes(bytes).WithRemoteEp(_senderEndPoint).Build();
     _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
 }
コード例 #6
0
        protected override void Given()
        {
            base.Given();

            _remoteEndPoint = TestConstants.IpEndPoint1;
            var response = new SipResponseBuilder().Build();
            var bytes    = new DataBytesBuilder().WithText(response.FormatEnvelopeToString()).Build();

            _packet  = new UdpPacketBuilder().WithDataBytes(bytes).WithRemoteEp(_remoteEndPoint).Build();
            _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
        }
コード例 #7
0
        protected override void Given()
        {
            base.Given();
            var parser = new Mock <ISipMessageParser>();

            parser.Setup(p => p.ParseSipMessage(It.IsAny <byte[]>(), It.IsAny <string>())).Throws(new SipParseException(""));

            _validator = new Mock <ISipValidator>();
            _packet    = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().WithText("nonsens").Build()).Build();
            _channel   = new UdpMessageChannel(new SipStack(), _validator.Object, parser.Object);
        }
コード例 #8
0
        protected override void Given()
        {
            base.Given();
            _senderEndPoint = TestConstants.IpEndPoint1;
            var via     = new SipViaHeaderBuilder().WithSentBy(_senderEndPoint).Build();
            var request = new SipRequestBuilder().WithVias(new SipViaHeaderListBuilder().Add(via).Build()).Build();
            var bytes   = new DataBytesBuilder().WithText(request.FormatEnvelopeToString()).Build();

            _packet  = new UdpPacketBuilder().WithDataBytes(bytes).WithRemoteEp(_senderEndPoint).Build();
            _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
        }
        protected override void Given()
        {
            base.Given();

            var request = new SipRequestBuilder()
               .WithRequestLine(new SipRequestLineBuilder().WithMethod(SipMethods.Register).Build())
               .WithCSeq(new SipCSeqHeaderBuilder().WithCommand(SipMethods.Invite).Build())
               .Build();
            _packet = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().WithText(request.FormatEnvelopeToString()).Build()).Build();
            _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
        }
        protected override void Given()
        {
            base.Given();

            var request = new SipRequestBuilder()
                          .WithRequestLine(new SipRequestLineBuilder().WithMethod(SipMethods.Register).Build())
                          .WithCSeq(new SipCSeqHeaderBuilder().WithCommand(SipMethods.Invite).Build())
                          .Build();

            _packet  = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().WithText(request.FormatEnvelopeToString()).Build()).Build();
            _channel = new UdpMessageChannel(new SipStack(), new SipValidator(), new SipMessageParser());
        }
        protected override void Given()
        {
            base.Given();
            var parser = new Mock<ISipMessageParser>();
            parser.Setup(p => p.ParseSipMessage(It.IsAny<byte[]>(), It.IsAny<string>()))
               .Returns(new SipRequestBuilder().Build());
            _validator = new Mock<ISipValidator>();
            _validator.Setup(v => v.ValidateMessage(It.IsAny<SipRequest>()))
                .Returns(new ValidateRequestResult() { HasUnSupportedSipVersion = true });
            _packet = new UdpPacketBuilder().Build();

            _channel = new UdpMessageChannel(new SipStack(), _validator.Object, parser.Object);
        }
        protected override void Given()
        {
            base.Given();
            var parser = new Mock<ISipMessageParser>();
            parser.Setup(p => p.ParseSipMessage(It.IsAny<byte[]>(), It.IsAny<string>()))
                .Returns(new SipRequestBuilder().Build());

            _validator = new Mock<ISipValidator>();
            _validator.Setup(v => v.ValidateMessage(It.IsAny<SipRequest>()))
                .Returns(new ValidateRequestResult()
                             {
                                 MissingRequiredHeader = SipHeaderNames.CallId
                             });
            _packet = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().Build()).Build();
            _channel = new UdpMessageChannel(new SipStack(), _validator.Object, parser.Object);
        }
コード例 #13
0
        protected override void Given()
        {
            base.Given();
            var parser = new Mock <ISipMessageParser>();

            parser.Setup(p => p.ParseSipMessage(It.IsAny <byte[]>(), It.IsAny <string>()))
            .Returns(new SipRequestBuilder().Build());
            _validator = new Mock <ISipValidator>();
            _validator.Setup(v => v.ValidateMessage(It.IsAny <SipRequest>()))
            .Returns(new ValidateRequestResult()
            {
                HasUnSupportedSipVersion = true
            });
            _packet = new UdpPacketBuilder().Build();

            _channel = new UdpMessageChannel(new SipStack(), _validator.Object, parser.Object);
        }
コード例 #14
0
        protected override void Given()
        {
            base.Given();
            var parser = new Mock <ISipMessageParser>();

            parser.Setup(p => p.ParseSipMessage(It.IsAny <byte[]>(), It.IsAny <string>()))
            .Returns(new SipRequestBuilder().Build());

            _validator = new Mock <ISipValidator>();
            _validator.Setup(v => v.ValidateMessage(It.IsAny <SipRequest>()))
            .Returns(new ValidateRequestResult()
            {
                MissingRequiredHeader = SipHeaderNames.CallId
            });
            _packet  = new UdpPacketBuilder().WithDataBytes(new DataBytesBuilder().Build()).Build();
            _channel = new UdpMessageChannel(new SipStack(), _validator.Object, parser.Object);
        }