Exemplo n.º 1
0
        public void VerifyCustomHeadersNotPresentWithEmptyDictionary()
        {
            SIPMessage message = SIPMessage.Faker.Generate(1).First();

            Assert.DoesNotContain("X-Test-Case: 1", message.ToString());
            Assert.DoesNotContain("X-", message.ToString());
        }
Exemplo n.º 2
0
        public void AllowMaxForwardsofZero()
        {
            SIPMessage message = SIPMessage.Faker.Generate(1).First();

            message.Header.MaxForwards = 0;

            Assert.Contains("Max-Forwards", message.ToString());
        }
Exemplo n.º 3
0
        public void CustomHeadersAreRendered()
        {
            SIPMessage message = SIPMessage.Faker.Generate(1).First();
            Dictionary <string, string> CustomHeaders = new Dictionary <string, string>();

            CustomHeaders.Add("Test-Case", "1");

            message.Header.CustomHeaders = CustomHeaders;

            Assert.Contains("X-Test-Case: 1", message.ToString());
        }
Exemplo n.º 4
0
        public void VerifyNoContentLengthIfBodyNotPresent()
        {
            Faker <SIPMessage> CustomFaker = new Faker <SIPMessage>()
                                             .StrictMode(false)
                                             .RuleFor(o => o.Body, f => null)
                                             .RuleFor(o => o.RequestLine, f => RequestLine.Faker.Generate(1).First())
                                             .RuleFor(o => o.Header, f => MessageHeader.Faker.Generate(1).First());

            SIPMessage.SetCustomFaker(CustomFaker);

            Assert.Equal(CustomFaker, SIPMessage.Faker);

            SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();

            Assert.Null(TestMessage.Body);
            Assert.DoesNotContain("Content-Length", TestMessage.ToString());
        }