Пример #1
0
        /// <summary>
        /// Tests whether the HTTP response message contains content header with certain name.
        /// </summary>
        /// <param name="name">Name of expected content header.</param>
        /// <returns>The same HTTP response message test builder.</returns>
        public IAndHttpResponseMessageTestBuilder ContainingContentHeader(string name)
        {
            HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
            HttpResponseMessageValidator.ContainingHeader(
                this.httpResponseMessage.Content.Headers,
                name,
                this.ThrowNewHttpResponseMessageAssertionException,
                isContentHeader: true);

            return(this);
        }
Пример #2
0
        /// <summary>
        /// Testuje, či správa odozvy HTTP obsahuje záhlavie obsahu s určitým názvom a zberom hodnoty.
        /// </summary>
        /// <param name="name">Name of expected content header.</param>
        /// <param name="values">Collection of values in the expected content header.</param>
        /// <returns>The same HTTP response message test builder.</returns>
        public IAndHttpHandlerResponseMessageTestBuilder ValidContainingContentHeader(string name, IEnumerable <string> values)
        {
            HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
            HttpResponseMessageValidator.ContainingHeader(
                this.httpResponseMessage.Content.Headers,
                name,
                values,
                this.ThrowNewHttpResponseMessageAssertionException,
                isContentHeader: true);

            return(this);
        }
Пример #3
0
        /// <summary>
        /// Testuje, či správa o odozve HTTP obsahuje hlavičky obsahu poskytnuté v slovníku.
        /// </summary>
        /// <param name="headers">Dictionary containing content headers.</param>
        /// <returns>The same HTTP response message test builder.</returns>
        public IAndHttpHandlerResponseMessageTestBuilder ValidContainingContentHeaders(
            IDictionary <string, IEnumerable <string> > headers)
        {
            HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
            HttpResponseMessageValidator.ValidateHeadersCount(
                headers,
                this.httpResponseMessage.Content.Headers,
                this.ThrowNewHttpResponseMessageAssertionException,
                isContentHeaders: true);

            headers.ForEach(h => this.ValidContainingContentHeader(h.Key, h.Value));
            return(this);
        }
Пример #4
0
 /// <summary>
 /// Tvrdi, ze hodnota je false
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="name">Nazvy property objektov</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldBeFalse(string name)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     HttpResponseMessageValidator.ShouldBeFalse(this.httpResponseMessage.Content, name, this.ThrowNewHttpResponseMessageAssertionException);
     return(this);
 }
Пример #5
0
 /// <summary>
 /// Tvrdi, ze hodnota nie je null
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldNotBeNull()
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     HttpResponseMessageValidator.ShouldNotBeNull(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     return(this);
 }
Пример #6
0
 /// <summary>
 /// Tvrdi, ze retazec obsahuje specifikovane ocakavane hodnoty
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="name">Nazvy property objektov</param>
 /// <param name="value">Specifikovane hodnoty</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldContainEquivalentOf(IEnumerable <string> names, long value)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     HttpResponseMessageValidator.ShouldContainEquivalentOf(this.httpResponseMessage.Content, names, value, this.ThrowNewHttpResponseMessageAssertionException);
     return(this);
 }
Пример #7
0
 /// <summary>
 /// Tvrdi, ze retazec obsahuje specifikovane ocakavane hodnoty
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="name">Nazvy property objektov</param>
 /// <param name="value">Specifikovane hodnoty</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldContainEquivalentOf(IDictionary <IEnumerable <string>, long> values)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     values.ForEach(v => this.CheckShouldContainEquivalentOf(v.Key, v.Value));
     return(this);
 }
Пример #8
0
 /// <summary>
 /// Tvrdi, ze ciselna hodnota je mensia alebo rovna ako ocakavana hodnota
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="name">Nazov property objektu</param>
 /// <param name="value">Specifikovane hodnoty</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldBeLessOrEqualTo(IDictionary <string, long> values)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     values.ForEach(v => this.CheckShouldBeLessOrEqualTo(v.Key, v.Value));
     return(this);
 }
Пример #9
0
 /// <summary>
 /// Tvrdenie, ze ciselna hodnota je vacsia alebo rovna ako zadana ocakavana hodnota
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="name">Nazov property objektu</param>
 /// <param name="value">Specifikovane hodnoty</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldBeGreaterOrEqualTo(string name, long value)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     HttpResponseMessageValidator.ShouldBeGreaterOrEqualTo(this.httpResponseMessage.Content, name, value, this.ThrowNewHttpResponseMessageAssertionException);
     return(this);
 }
Пример #10
0
 /// <summary>
 /// Tvrdenie, ze pocet poloziek v kolekcii je mensi alebo rovnaky ako ocakavana hodnota
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="value">Ocakavana hodnota objektu</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldHaveCountLessOrEqualTo(int value)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     HttpResponseMessageValidator.ShouldHaveCountLessOrEqualTo(this.httpResponseMessage.Content, value, this.ThrowNewHttpResponseMessageAssertionException);
     return(this);
 }
Пример #11
0
 /// <summary>
 /// Tvrdenie, ze System.String je jednou zo specifikovanych values
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="name">Nazov property objektu</param>
 /// <param name="values">Specifikovane hodnoty</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldBeOneOf(string name, IEnumerable <string> values)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     HttpResponseMessageValidator.ShouldBeOneOf(this.httpResponseMessage.Content, name, values, this.ThrowNewHttpResponseMessageAssertionException);
     return(this);
 }
Пример #12
0
 /// <summary>
 /// Tvrdi, ze aktualny System.DateTime je teraz alebo predtym
 /// </summary>
 /// <param name="actualContent">Aktualny Http content</param>
 /// <param name="name">Nazvy property objektov</param>
 /// <param name="value">Specifikovane hodnoty</param>
 public IAndHttpHandlerResponseMessageTestBuilder CheckShouldBeOnOrBefore(IDictionary <string, DateTime> values)
 {
     HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException);
     values.ForEach(h => HttpResponseMessageValidator.ShouldBeOnOrBefore(this.httpResponseMessage.Content, h.Key, h.Value, this.ThrowNewHttpResponseMessageAssertionException));
     return(this);
 }