Interface IResponseCookieTestBuilder
Used for testing Microsoft.AspNetCore.Http.HttpResponse cookie.
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Http
Assembly:MyTested.AspNetCore.Mvc.Http.dll
Syntax
public interface IResponseCookieTestBuilder
Methods
| Improve this Doc View SourceWithDomain(String)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.Domain property is the same as provided one.
Declaration
IAndResponseCookieTestBuilder WithDomain(string domain)
Parameters
Type | Name | Description |
---|---|---|
System.String | domain | Expected domain of the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithExpired(Nullable<DateTimeOffset>)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.Expires property is the same as provided one.
Declaration
IAndResponseCookieTestBuilder WithExpired(DateTimeOffset? expires)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTimeOffset> | expires | Expected expiration date time offset of the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithHttpOnly(Boolean)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.HttpOnly property is the same as provided one.
Declaration
IAndResponseCookieTestBuilder WithHttpOnly(bool httpOnly)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | httpOnly | Expected Microsoft.Net.Http.Headers.SetCookieHeaderValue.HttpOnly property of the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithMaxAge(Nullable<TimeSpan>)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.MaxAge property is the same as provided one.
Declaration
IAndResponseCookieTestBuilder WithMaxAge(TimeSpan? maxAge)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | maxAge | Expected Microsoft.Net.Http.Headers.SetCookieHeaderValue.MaxAge property of the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithName(String)
Sets the expected Microsoft.Net.Http.Headers.SetCookieHeaderValue.Name of the tested cookie.
Declaration
IAndResponseCookieTestBuilder WithName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name to set on the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithPath(String)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.Path property is the same as provided one.
Declaration
IAndResponseCookieTestBuilder WithPath(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Expected Microsoft.Net.Http.Headers.SetCookieHeaderValue.Path property of the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithSecure(Boolean)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.Secure property is the same as provided one.
Declaration
IAndResponseCookieTestBuilder WithSecure(bool secure)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | secure | Expected Microsoft.Net.Http.Headers.SetCookieHeaderValue.Secure property of the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithValue(Action<String>)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.Value passes the provided assertions.
Declaration
IAndResponseCookieTestBuilder WithValue(Action<string> assertions)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.String> | assertions | Action containing assertions on the cookie value. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithValue(Func<String, Boolean>)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.Value passes the provided predicate.
Declaration
IAndResponseCookieTestBuilder WithValue(Func<string, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.String, System.Boolean> | predicate | Predicate testing the cookie value. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |
WithValue(String)
Tests whether the Microsoft.Net.Http.Headers.SetCookieHeaderValue.Value property is the same as the provided one.
Declaration
IAndResponseCookieTestBuilder WithValue(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Expected value of the cookie. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndResponseCookieTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpResponseTestBuilder. |