MY TESTED ASP.NET CORE MVC DOCS
  • Tutorial
  • Testing Guide
  • API Reference
  • Troubleshoot
  • About
  • API Reference
  • MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json
  • IJsonTestBuilder
Show / Hide Table of Contents
  • Common Classes & Extensions
    • ActionAttributesTestBuilderViewFeaturesExtensions
    • AuthenticationScheme
    • BadRequestTestBuilderDataAnnotationsExtensions
    • BadRequestTestBuilderExtensions
    • BaseShouldReturnTestBuilderExtensions
    • BaseTestBuilderWithResponseModelExtensions
    • ComponentBuilderAuthenticationExtensions
    • ComponentBuilderCachingExtensions
    • ComponentBuilderDependencyInjectionExtensions
    • ComponentBuilderEntityFrameworkCoreExtensions
    • ComponentBuilderHttpExtensions
    • ComponentBuilderOptionsExtensions
    • ComponentBuilderRoutingExtensions
    • ComponentBuilderSessionExtensions
    • ComponentBuilderTempDataExtensions
    • ComponentShouldHaveTestBuilderCachingExtensions
    • ComponentShouldHaveTestBuilderEntityFrameworkCoreExtensions
    • ComponentShouldHaveTestBuilderHttpExtensions
    • ComponentShouldHaveTestBuilderModelStateExtensions
    • ComponentShouldHaveTestBuilderSessionExtensions
    • ComponentShouldHaveTestBuilderTempDataExtensions
    • ComponentShouldHaveTestBuilderViewBagExtensions
    • ComponentShouldHaveTestBuilderViewDataExtensions
    • ContentType
    • ControllerBuilderDataAnnotationsExtensions
    • CreatedTestBuilderExtensions
    • From
    • HttpHeader
    • HttpMethod
    • HttpRequestBuilderAuthenticationExtensions
    • HttpRequestBuilderViewFeaturesExtensions
    • HttpScheme
    • HttpStatusCode
    • LocalRedirectTestBuilderExtensions
    • ModelErrorDetailsTestBuilderViewFeaturesExtensions
    • ModelErrorTestBuilderViewFeaturesExtensions
    • MyApplication
    • MyController<TController>
    • MyMvc
    • MyRouting
    • MyViewComponent<TViewComponent>
    • RedirectTestBuilderExtensions
    • ResolvedRouteTestBuilderDataAnnotationsExtensions
    • ServiceCollectionAbstractionsExtensions
    • ServiceCollectionCachingExtensions
    • ServiceCollectionControllersExtensions
    • ServiceCollectionCoreExtensions
    • ServiceCollectionEntityFrameworkCoreExtensions
    • ServiceCollectionExtensions
    • ServiceCollectionHttpExtensions
    • ServiceCollectionOptionsExtensions
    • ServiceCollectionRoutingExtensions
    • ServiceCollectionSessionExtensions
    • ServiceCollectionTempDataExtensions
    • ServiceCollectionUniverseExtensions
    • ServiceCollectionViewComponentsExtensions
    • ServiceCollectionViewFeaturesExtensions
    • ShouldReturnTestBuilderExtensions
    • ShouldReturnTestBuilderJsonResultExtensions
    • ShouldReturnTestBuilderPartialViewResultExtensions
    • ShouldReturnTestBuilderViewComponentResultExtensions
    • ShouldReturnTestBuilderViewResultExtensions
    • ViewComponentShouldReturnTestBuilderExtensions
    • With
  • ActionResults.BadRequest
    • IBadRequestErrorMessageTestBuilder
    • IBadRequestTestBuilder
  • ActionResults.Challenge
    • IChallengeTestBuilder
  • ActionResults.Content
    • IContentTestBuilder
  • ActionResults.Created
    • ICreatedTestBuilder
  • ActionResults.File
    • IFileTestBuilder
    • IPhysicalFileTestBuilder
  • ActionResults.Forbid
    • IForbidTestBuilder
  • ActionResults.Json
    • IJsonSerializerSettingsTestBuilder
    • IJsonTestBuilder
  • ActionResults.LocalRedirect
    • ILocalRedirectTestBuilder
  • ActionResults.NotFound
    • INotFoundTestBuilder
  • ActionResults.Object
    • IObjectTestBuilder
  • ActionResults.Ok
    • IOkTestBuilder
  • ActionResults.Redirect
    • IRedirectTestBuilder
  • ActionResults.StatusCode
    • IStatusCodeTestBuilder
  • ActionResults.View
    • IViewComponentTestBuilder
    • IViewTestBuilder
  • Actions
    • IActionResultTestBuilder<TActionResult>
    • IShouldHaveTestBuilder<TActionResult>
    • IShouldReturnTestBuilder<TActionResult>
    • IVoidActionResultTestBuilder
  • Application
    • IApplicationConfigurationBuilder
  • Attributes
    • IActionAttributesTestBuilder
    • IBaseAttributesTestBuilder<TAttributesTestBuilder>
    • IControllerActionAttributesTestBuilder<TAttributesTestBuilder>
    • IControllerAttributesTestBuilder
    • IViewComponentAttributesTestBuilder
  • Authentication
    • IAuthenticationPropertiesTestBuilder
    • IClaimsIdentityBuilder
    • IClaimsPrincipalBuilder
  • Base
    • IBaseTestBuilder
    • IBaseTestBuilderWithAction
    • IBaseTestBuilderWithActionResult<TActionResult>
    • IBaseTestBuilderWithComponent
    • IBaseTestBuilderWithComponentBuilder<TBuilder>
    • IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>
    • IBaseTestBuilderWithController
    • IBaseTestBuilderWithInvokedAction
    • IBaseTestBuilderWithModel<TModel>
    • IBaseTestBuilderWithModelError
    • IBaseTestBuilderWithResponseModel
    • IBaseTestBuilderWithViewComponent
    • IBaseTestBuilderWithViewComponentInvocation
    • IBaseTestBuilderWithViewComponentResult<TInvocationResult>
  • CaughtExceptions
    • IAggregateExceptionTestBuilder
    • IBaseExceptionTestBuilder
    • IExceptionMessageTestBuilder
    • IExceptionTestBuilder
    • IShouldThrowTestBuilder
  • Controllers
    • IControllerBuilder<TController>
    • IControllerTestBuilder
  • Data
    • IDataProviderEntryDetailsTestBuilder<TValue>
    • IDataProviderEntryKeyTestBuilder
    • IDataProviderEntryTestBuilder
    • IDbContextBuilder
    • IDbContextTestBuilder
    • IMemoryCacheBuilder
    • IMemoryCacheEntryBuilder
    • IMemoryCacheEntryDetailsTestBuilder<TValue>
    • IMemoryCacheEntryKeyBuilder
    • IMemoryCacheEntryKeyTestBuilder
    • IMemoryCacheEntryTestBuilder
    • IMemoryCacheTestBuilder
    • ISessionBuilder
    • ISessionTestBuilder
    • ITempDataBuilder
    • ITempDataTestBuilder
    • IViewBagTestBuilder
    • IViewDataTestBuilder
  • Http
    • IHttpRequestBuilder
    • IHttpResponseTestBuilder
    • IResponseCookieTestBuilder
  • Invocations
    • IBaseShouldReturnTestBuilder
    • IBaseShouldReturnTestBuilder<TInvocationResult, TBuilder>
    • IBaseShouldReturnTestBuilder<TInvocationResult>
    • IViewComponentResultTestBuilder<TInvocationResult>
    • IViewComponentShouldHaveTestBuilder<TInvocationResult>
    • IViewComponentShouldReturnTestBuilder<TInvocationResult>
  • Models
    • IModelDetailsTestBuilder<TModel>
    • IModelErrorDetailsTestBuilder
    • IModelErrorDetailsTestBuilder<TModel>
    • IModelErrorTestBuilder
    • IModelErrorTestBuilder<TModel>
    • IModelStateTestBuilder
  • Options
    • IOptionsBuilder
  • Routing
    • IResolvedRouteTestBuilder
    • IRouteTestBuilder
    • IShouldMapTestBuilder
  • Services
    • IServicesBuilder
  • Uri
    • IUriBuilder
    • IUriTestBuilder
  • ViewComponentResults
    • IViewTestBuilder
  • ViewComponents
    • IViewComponentBuilder<TViewComponent>
    • IViewComponentTestBuilder

Interface IJsonTestBuilder

Used for testing Microsoft.AspNetCore.Mvc.JsonResult.

Inherited Members
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Action<TComponent>)
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Func<TComponent, Boolean>)
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json
Assembly:MyTested.AspNetCore.Mvc.ViewActionResults.dll
Syntax
public interface IJsonTestBuilder : IBaseTestBuilderWithResponseModel, IBaseTestBuilderWithActionResult<JsonResult>, IBaseTestBuilderWithInvokedAction, IBaseTestBuilderWithAction, IBaseTestBuilderWithComponent, IBaseTestBuilder

Methods

| Improve this Doc View Source

WithContentType(MediaTypeHeaderValue)

Tests whether Microsoft.AspNetCore.Mvc.JsonResult has the same content type as the provided MediaTypeHeaderValue.

Declaration
IAndJsonTestBuilder WithContentType(MediaTypeHeaderValue contentType)
Parameters
Type Name Description
Microsoft.Net.Http.Headers.MediaTypeHeaderValue contentType

Content type as MediaTypeHeaderValue.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder

The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder.

| Improve this Doc View Source

WithContentType(String)

Tests whether Microsoft.AspNetCore.Mvc.JsonResult has the same content type as the provided string.

Declaration
IAndJsonTestBuilder WithContentType(string contentType)
Parameters
Type Name Description
System.String contentType

ContentType type as string.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder

The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder.

| Improve this Doc View Source

WithDefaulJsonSerializerSettings()

Tests whether Microsoft.AspNetCore.Mvc.JsonResult has the default JsonSerializerSettings.

Declaration
IAndJsonTestBuilder WithDefaulJsonSerializerSettings()
Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder

The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder.

| Improve this Doc View Source

WithJsonSerializerSettings(JsonSerializerSettings)

Tests whether Microsoft.AspNetCore.Mvc.JsonResult has the provided JsonSerializerSettings.

Declaration
IAndJsonTestBuilder WithJsonSerializerSettings(JsonSerializerSettings jsonSerializerSettings)
Parameters
Type Name Description
Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings

Expected JsonSerializerSettings to test with.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder

The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder.

| Improve this Doc View Source

WithJsonSerializerSettings(Action<IJsonSerializerSettingsTestBuilder>)

Tests whether Microsoft.AspNetCore.Mvc.JsonResult has JsonSerializerSettings by using builder.

Declaration
IAndJsonTestBuilder WithJsonSerializerSettings(Action<IJsonSerializerSettingsTestBuilder> jsonSerializerSettingsBuilder)
Parameters
Type Name Description
System.Action<IJsonSerializerSettingsTestBuilder> jsonSerializerSettingsBuilder

Builder for creating JsonSerializerSettings.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder

The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder.

| Improve this Doc View Source

WithStatusCode(Int32)

Tests whether Microsoft.AspNetCore.Mvc.JsonResult has the same status code as the provided one.

Declaration
IAndJsonTestBuilder WithStatusCode(int statusCode)
Parameters
Type Name Description
System.Int32 statusCode

Status code as integer.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder

The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder.

| Improve this Doc View Source

WithStatusCode(HttpStatusCode)

Tests whether Microsoft.AspNetCore.Mvc.JsonResult has the same status code as the provided HttpStatusCode.

Declaration
IAndJsonTestBuilder WithStatusCode(HttpStatusCode statusCode)
Parameters
Type Name Description
System.Net.HttpStatusCode statusCode

HttpStatusCode enumeration.

Returns
Type Description
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder

The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.Json.IAndJsonTestBuilder.

  • Improve this Doc
  • View Source
In This Article
  • Methods
    • WithContentType(MediaTypeHeaderValue)
    • WithContentType(String)
    • WithDefaulJsonSerializerSettings()
    • WithJsonSerializerSettings(JsonSerializerSettings)
    • WithJsonSerializerSettings(Action<IJsonSerializerSettingsTestBuilder>)
    • WithStatusCode(Int32)
    • WithStatusCode(HttpStatusCode)
Back to top Copyright © 2015-2016 MyTestedASP.NET. All Rights Reserved. Generated by DocFX