diff --git a/src/Examples/GettingStarted/ResourceDefinitionExample/Model.cs b/src/Examples/GettingStarted/ResourceDefinitionExample/Model.cs index 0bee86efe0..44a421e112 100644 --- a/src/Examples/GettingStarted/ResourceDefinitionExample/Model.cs +++ b/src/Examples/GettingStarted/ResourceDefinitionExample/Model.cs @@ -5,6 +5,6 @@ namespace GettingStarted.ResourceDefinitionExample public class Model : Identifiable { [Attr] - public string DontExpose { get; set; } + public string DoNotExpose { get; set; } } -} \ No newline at end of file +} diff --git a/src/Examples/GettingStarted/ResourceDefinitionExample/ModelDefinition.cs b/src/Examples/GettingStarted/ResourceDefinitionExample/ModelDefinition.cs index 6fd6a131f4..1948a13dd7 100644 --- a/src/Examples/GettingStarted/ResourceDefinitionExample/ModelDefinition.cs +++ b/src/Examples/GettingStarted/ResourceDefinitionExample/ModelDefinition.cs @@ -13,7 +13,7 @@ public ModelDefinition(IResourceGraph resourceGraph) : base(resourceGraph) // this might be used if the incoming value gets hashed or // encrypted prior to being persisted and this value should // never be sent back to the client - HideFields(model => model.DontExpose); + HideFields(model => model.DoNotExpose); } } } diff --git a/src/Examples/GettingStarted/Startup.cs b/src/Examples/GettingStarted/Startup.cs index 75a4704301..c467b9cccd 100644 --- a/src/Examples/GettingStarted/Startup.cs +++ b/src/Examples/GettingStarted/Startup.cs @@ -22,7 +22,7 @@ public void ConfigureServices(IServiceCollection services) public void Configure(IApplicationBuilder app, SampleDbContext context) { - context.Database.EnsureDeleted(); // indicies need to be reset + context.Database.EnsureDeleted(); // indices need to be reset app.UseJsonApi(); } } diff --git a/src/JsonApiDotNetCore/Configuration/DefaultAttributeResponseBehavior.cs b/src/JsonApiDotNetCore/Configuration/DefaultAttributeResponseBehavior.cs index 48801eed01..fe14393b95 100644 --- a/src/JsonApiDotNetCore/Configuration/DefaultAttributeResponseBehavior.cs +++ b/src/JsonApiDotNetCore/Configuration/DefaultAttributeResponseBehavior.cs @@ -1,14 +1,14 @@ -namespace JsonApiDotNetCore.Configuration +namespace JsonApiDotNetCore.Configuration { /// - /// Allows default valued attributes to be ommitted from the response payload + /// Allows default valued attributes to be omitted from the response payload /// public struct DefaultAttributeResponseBehavior { /// Do not serialize default value attributes /// - /// Allow clients to override the serialization behavior through a query parmeter. + /// Allow clients to override the serialization behavior through a query parameter. /// /// ``` /// GET /articles?omitDefaultValuedAttributes=true diff --git a/src/JsonApiDotNetCore/Configuration/ILinksConfiguration.cs b/src/JsonApiDotNetCore/Configuration/ILinksConfiguration.cs index a372d61e67..cc782f79ab 100644 --- a/src/JsonApiDotNetCore/Configuration/ILinksConfiguration.cs +++ b/src/JsonApiDotNetCore/Configuration/ILinksConfiguration.cs @@ -1,4 +1,4 @@ -using JsonApiDotNetCore.Models.Links; +using JsonApiDotNetCore.Models.Links; namespace JsonApiDotNetCore.Configuration { @@ -33,20 +33,20 @@ public interface ILinksConfiguration /// /// Configures globally which links to show in the /// object for a requested resource. Setting can be overriden per resource by - /// adding a to the class definitio of that resource. + /// adding a to the class definition of that resource. /// Link TopLevelLinks { get; } /// /// Configures globally which links to show in the /// object for a requested resource. Setting can be overriden per resource by - /// adding a to the class definitio of that resource. + /// adding a to the class definition of that resource. /// Link ResourceLinks { get; } /// /// Configures globally which links to show in the /// object for a requested resource. Setting can be overriden per resource by - /// adding a to the class definitio of that resource. + /// adding a to the class definition of that resource. /// Option can also be specified per relationship by using the associated links argument /// in the constructor of . /// @@ -68,4 +68,4 @@ public interface ILinksConfiguration Link RelationshipLinks { get; } } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs b/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs index 3fd4946c03..0952a7fb0f 100644 --- a/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs +++ b/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs @@ -83,7 +83,7 @@ public class JsonApiOptions : IJsonApiOptions /// /// Whether or not clients can provide ids when creating resources. /// Defaults to false. When disabled the application will respond - /// with a 403 Forbidden respponse if a client attempts to create a + /// with a 403 Forbidden response if a client attempts to create a /// resource with a defined id. /// /// diff --git a/src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs b/src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs index 125d38b5fc..f1b26e110d 100644 --- a/src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs +++ b/src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs @@ -1,13 +1,13 @@ namespace JsonApiDotNetCore.Configuration { /// - /// Allows null attributes to be ommitted from the response payload + /// Allows null attributes to be omitted from the response payload /// public struct NullAttributeResponseBehavior { /// Do not serialize null attributes /// - /// Allow clients to override the serialization behavior through a query parmeter. + /// Allow clients to override the serialization behavior through a query parameter. /// /// ``` /// GET /articles?omitNullValuedAttributes=true diff --git a/src/JsonApiDotNetCore/Data/DefaultResourceRepository.cs b/src/JsonApiDotNetCore/Data/DefaultResourceRepository.cs index 079115d378..2986de134c 100644 --- a/src/JsonApiDotNetCore/Data/DefaultResourceRepository.cs +++ b/src/JsonApiDotNetCore/Data/DefaultResourceRepository.cs @@ -147,7 +147,7 @@ private bool IsHasOneRelationship(string internalRelationshipName, Type type) return false; } // relationshipAttr is null when we don't put a [RelationshipAttribute] on the inverse navigation property. - // In this case we use relfection to figure out what kind of relationship is pointing back. + // In this case we use reflection to figure out what kind of relationship is pointing back. return !type.GetProperty(internalRelationshipName).PropertyType.Inherits(typeof(IEnumerable)); } @@ -359,12 +359,12 @@ public async Task> ToListAsync(IQueryable en /// /// Before assigning new relationship values (UpdateAsync), we need to - /// attach the current database values of the relationship to the dbcontext, else + /// attach the current database values of the relationship to the dbContext, else /// it will not perform a complete-replace which is required for /// one-to-many and many-to-many. /// - /// For example: a person `p1` has 2 todoitems: `t1` and `t2`. - /// If we want to update this todoitem set to `t3` and `t4`, simply assigning + /// For example: a person `p1` has 2 todo-items: `t1` and `t2`. + /// If we want to update this todo-item set to `t3` and `t4`, simply assigning /// `p1.todoItems = [t3, t4]` will result in EF Core adding them to the set, /// resulting in `[t1 ... t4]`. Instead, we should first include `[t1, t2]`, /// after which the reassignment `p1.todoItems = [t3, t4]` will actually @@ -383,7 +383,7 @@ protected void LoadCurrentRelationships(TResource oldEntity, RelationshipAttribu } /// - /// Given a iidentifiable relationshipvalue, verify if an entity of the underlying + /// Given a IIdentifiable relationship value, verify if an entity of the underlying /// type with the same ID is already attached to the dbContext, and if so, return it. /// If not, attach the relationship value to the dbContext. /// diff --git a/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs b/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs index eb30283428..8a3c19b41e 100644 --- a/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs +++ b/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs @@ -76,7 +76,7 @@ public static IServiceCollection AddResourceService(this IServiceCollection s { foreach (var openGenericType in ServiceDiscoveryFacade.ServiceInterfaces) { - // A shorthand interface is one where the id type is ommitted + // A shorthand interface is one where the id type is omitted // e.g. IResourceService is the shorthand for IResourceService var isShorthandInterface = (openGenericType.GetTypeInfo().GenericTypeParameters.Length == 1); if (isShorthandInterface && resourceDescriptor.IdType != typeof(int)) @@ -102,7 +102,7 @@ public static IServiceCollection AddResourceService(this IServiceCollection s private static HashSet GetResourceTypesFromServiceImplementation(Type type) { - var resourceDecriptors = new HashSet(); + var resourceDescriptors = new HashSet(); var interfaces = type.GetInterfaces(); foreach (var i in interfaces) { @@ -111,11 +111,11 @@ private static HashSet GetResourceTypesFromServiceImplementa var firstGenericArgument = i.GenericTypeArguments.FirstOrDefault(); if (TypeLocator.TryGetResourceDescriptor(firstGenericArgument, out var resourceDescriptor) == true) { - resourceDecriptors.Add(resourceDescriptor); + resourceDescriptors.Add(resourceDescriptor); } } } - return resourceDecriptors; + return resourceDescriptors; } } } diff --git a/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs b/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs index aa8b779992..d264f94365 100644 --- a/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs +++ b/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCore.Formatters /// /// Formats the response data used https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/formatting?view=aspnetcore-3.0. /// It was intended to have as little dependencies as possible in formatting layer for greater extensibility. - /// It onls depends on . + /// It only depends on . /// public class JsonApiWriter : IJsonApiWriter { @@ -57,7 +57,7 @@ public async Task WriteAsync(OutputFormatterWriteContext context) } catch (Exception e) { - _logger?.LogError(new EventId(), e, "An error ocurred while formatting the response"); + _logger?.LogError(new EventId(), e, "An error occurred while formatting the response"); var errors = new ErrorCollection(); errors.Add(new Error(500, e.Message, ErrorMeta.FromException(e))); responseContent = _serializer.Serialize(errors); diff --git a/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/IResourceNameFormatter.cs b/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/IResourceNameFormatter.cs index 9de1a7c6a6..4795c33d31 100644 --- a/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/IResourceNameFormatter.cs +++ b/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/IResourceNameFormatter.cs @@ -19,7 +19,7 @@ public interface IResourceNameFormatter string FormatPropertyName(PropertyInfo property); /// - /// Aoplies the desired casing convention to the internal string. + /// Applies the desired casing convention to the internal string. /// This is generally applied to the type name after pluralization. /// string ApplyCasingConvention(string properName); diff --git a/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/ResourceNameFormatterBase.cs b/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/ResourceNameFormatterBase.cs index 6c6fc86f36..1c092a912b 100644 --- a/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/ResourceNameFormatterBase.cs +++ b/src/JsonApiDotNetCore/Graph/ResourceNameFormatters/ResourceNameFormatterBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using Humanizer; using JsonApiDotNetCore.Models; @@ -28,7 +28,7 @@ public string FormatResourceName(Type type) } /// - /// Aoplies the desired casing convention to the internal string. + /// Applies the desired casing convention to the internal string. /// This is generally applied to the type name after pluralization. /// public abstract string ApplyCasingConvention(string properName); diff --git a/src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs b/src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs index ac5cdd79fa..b3c922e02e 100644 --- a/src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs +++ b/src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs @@ -68,7 +68,7 @@ public ServiceDiscoveryFacade AddAssembly(Assembly assembly) { AddDbContextResolvers(assembly); - var resourceDescriptors = TypeLocator.GetIdentifableTypes(assembly); + var resourceDescriptors = TypeLocator.GetIdentifiableTypes(assembly); foreach (var resourceDescriptor in resourceDescriptors) { AddResource(assembly, resourceDescriptor); @@ -109,7 +109,7 @@ private void AddDbContextResolvers(Assembly assembly) /// The assembly to search for resources in. public ServiceDiscoveryFacade AddResources(Assembly assembly) { - var identifiables = TypeLocator.GetIdentifableTypes(assembly); + var identifiables = TypeLocator.GetIdentifiableTypes(assembly); foreach (var identifiable in identifiables) AddResource(assembly, identifiable); @@ -149,7 +149,7 @@ private void AddResourceToGraph(ResourceDescriptor identifiable) /// The assembly to search for resources in. public ServiceDiscoveryFacade AddServices(Assembly assembly) { - var resourceDescriptors = TypeLocator.GetIdentifableTypes(assembly); + var resourceDescriptors = TypeLocator.GetIdentifiableTypes(assembly); foreach (var resourceDescriptor in resourceDescriptors) { AddServices(assembly, resourceDescriptor); @@ -171,7 +171,7 @@ private void AddServices(Assembly assembly, ResourceDescriptor resourceDescripto /// The assembly to search for resources in. public ServiceDiscoveryFacade AddRepositories(Assembly assembly) { - var resourceDescriptors = TypeLocator.GetIdentifableTypes(assembly); + var resourceDescriptors = TypeLocator.GetIdentifiableTypes(assembly); foreach (var resourceDescriptor in resourceDescriptors) { AddRepositories(assembly, resourceDescriptor); diff --git a/src/JsonApiDotNetCore/Graph/TypeLocator.cs b/src/JsonApiDotNetCore/Graph/TypeLocator.cs index de5a2cd82f..2e58f0d3ea 100644 --- a/src/JsonApiDotNetCore/Graph/TypeLocator.cs +++ b/src/JsonApiDotNetCore/Graph/TypeLocator.cs @@ -29,12 +29,12 @@ public static Type GetIdType(Type resourceType) /// /// Get all implementations of in the assembly /// - public static IEnumerable GetIdentifableTypes(Assembly assembly) + public static IEnumerable GetIdentifiableTypes(Assembly assembly) => (_identifiableTypeCache.TryGetValue(assembly, out var descriptors) == false) - ? FindIdentifableTypes(assembly) + ? FindIdentifiableTypes(assembly) : _identifiableTypeCache[assembly]; - private static IEnumerable FindIdentifableTypes(Assembly assembly) + private static IEnumerable FindIdentifiableTypes(Assembly assembly) { var descriptors = new List(); _identifiableTypeCache[assembly] = descriptors; @@ -107,7 +107,7 @@ public static (Type implementation, Type registrationInterface) GetGenericInterf } /// - /// Get all derivitives of the concrete, generic type. + /// Get all derivatives of the concrete, generic type. /// /// The assembly to search /// The open generic type, e.g. `typeof(ResourceDefinition<>)` @@ -124,7 +124,7 @@ public static IEnumerable GetDerivedGenericTypes(Assembly assembly, Type o } /// - /// Get all derivitives of the specified type. + /// Get all derivatives of the specified type. /// /// The assembly to search /// The inherited type diff --git a/src/JsonApiDotNetCore/Hooks/Execution/HookExecutorHelper.cs b/src/JsonApiDotNetCore/Hooks/Execution/HookExecutorHelper.cs index c52e64bd37..b47d1e47db 100644 --- a/src/JsonApiDotNetCore/Hooks/Execution/HookExecutorHelper.cs +++ b/src/JsonApiDotNetCore/Hooks/Execution/HookExecutorHelper.cs @@ -80,8 +80,8 @@ public IEnumerable LoadDbValues(LeftType entityTypeForRepository, IEnumerable en var parameterizedGetWhere = GetType() .GetMethod(nameof(GetWhereAndInclude), BindingFlags.NonPublic | BindingFlags.Instance) .MakeGenericMethod(entityTypeForRepository, idType); - var casted = ((IEnumerable)entities).Cast(); - var ids = casted.Select(e => e.StringId).Cast(idType); + var cast = ((IEnumerable)entities).Cast(); + var ids = cast.Select(e => e.StringId).Cast(idType); var values = (IEnumerable)parameterizedGetWhere.Invoke(this, new object[] { ids, relationshipsToNextLayer }); if (values == null) return null; return (IEnumerable)Activator.CreateInstance(typeof(HashSet<>).MakeGenericType(entityTypeForRepository), values.Cast(entityTypeForRepository)); @@ -155,7 +155,7 @@ public Dictionary LoadImplicitlyAffected( { if (IsHasManyThrough(kvp, out var lefts, out var relationship)) continue; - // note that we dont't have to check if BeforeImplicitUpdate hook is implemented. If not, it wont ever get here. + // note that we don't have to check if BeforeImplicitUpdate hook is implemented. If not, it wont ever get here. var includedLefts = LoadDbValues(relationship.LeftType, lefts, ResourceHook.BeforeImplicitUpdateRelationship, relationship); foreach (IIdentifiable ip in includedLefts) @@ -171,17 +171,17 @@ public Dictionary LoadImplicitlyAffected( { dbRightEntityList = (IList)relationshipValue; } - var dbRightEntityListCasted = dbRightEntityList.Cast().ToList(); - if (existingRightEntities != null) dbRightEntityListCasted = dbRightEntityListCasted.Except(existingRightEntities.Cast(), _comparer).ToList(); + var dbRightEntityListCast = dbRightEntityList.Cast().ToList(); + if (existingRightEntities != null) dbRightEntityListCast = dbRightEntityListCast.Except(existingRightEntities.Cast(), _comparer).ToList(); - if (dbRightEntityListCasted.Any()) + if (dbRightEntityListCast.Any()) { if (!implicitlyAffected.TryGetValue(relationship, out IEnumerable affected)) { affected = TypeHelper.CreateListFor(relationship.RightType); implicitlyAffected[relationship] = affected; } - ((IList)affected).AddRange(dbRightEntityListCasted); + ((IList)affected).AddRange(dbRightEntityListCast); } } } diff --git a/src/JsonApiDotNetCore/Hooks/Execution/IHookExecutorHelper.cs b/src/JsonApiDotNetCore/Hooks/Execution/IHookExecutorHelper.cs index 214f1b000d..046d12609c 100644 --- a/src/JsonApiDotNetCore/Hooks/Execution/IHookExecutorHelper.cs +++ b/src/JsonApiDotNetCore/Hooks/Execution/IHookExecutorHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using JsonApiDotNetCore.Models; @@ -9,7 +9,7 @@ namespace JsonApiDotNetCore.Hooks /// A helper class for retrieving meta data about hooks, /// fetching database values and performing other recurring internal operations. /// - /// Used internalyl by + /// Used internally by /// internal interface IHookExecutorHelper { @@ -49,13 +49,13 @@ internal interface IHookExecutorHelper IEnumerable LoadDbValues(Type repositoryEntityType, IEnumerable entities, ResourceHook hook, params RelationshipAttribute[] relationships); /// - /// Checks if the display database values option is allowed for the targetd hook, and for + /// Checks if the display database values option is allowed for the targeted hook, and for /// a given resource of type checks if this hook is implemented and if the /// database values option is enabled. /// - /// true, if load db values was shoulded, false otherwise. + /// true, if should load db values, false otherwise. /// Container entity type. /// Hook. bool ShouldLoadDbValues(Type entityType, ResourceHook hook); } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Hooks/ResourceHookExecutor.cs b/src/JsonApiDotNetCore/Hooks/ResourceHookExecutor.cs index f8e4dad3ac..73c811e7e8 100644 --- a/src/JsonApiDotNetCore/Hooks/ResourceHookExecutor.cs +++ b/src/JsonApiDotNetCore/Hooks/ResourceHookExecutor.cs @@ -236,19 +236,19 @@ void RecursiveBeforeRead(List relationshipChain, Resource /// related to article2. Then, the following nested hooks need to be fired in the following order. /// First the BeforeUpdateRelationship should be for owner1, then the /// BeforeImplicitUpdateRelationship hook should be fired for - /// owner2, and lastely the BeforeImplicitUpdateRelationship for article2. + /// owner2, and lastly the BeforeImplicitUpdateRelationship for article2. void FireNestedBeforeUpdateHooks(ResourcePipeline pipeline, NodeLayer layer) { foreach (INode node in layer) { - var nestedHookcontainer = _executorHelper.GetResourceHookContainer(node.ResourceType, ResourceHook.BeforeUpdateRelationship); + var nestedHookContainer = _executorHelper.GetResourceHookContainer(node.ResourceType, ResourceHook.BeforeUpdateRelationship); IEnumerable uniqueEntities = node.UniqueEntities; RightType entityType = node.ResourceType; - Dictionary currenEntitiesGrouped; + Dictionary currentEntitiesGrouped; Dictionary currentEntitiesGroupedInverse; // fire the BeforeUpdateRelationship hook for owner_new - if (nestedHookcontainer != null) + if (nestedHookContainer != null) { if (uniqueEntities.Cast().Any()) { @@ -262,11 +262,11 @@ void FireNestedBeforeUpdateHooks(ResourcePipeline pipeline, NodeLayer layer) /// we want want inverse relationship attribute: /// we now have the one pointing from article -> person, ] /// but we require the the one that points from person -> article - currenEntitiesGrouped = node.RelationshipsFromPreviousLayer.GetRightEntities(); - currentEntitiesGroupedInverse = ReplaceKeysWithInverseRelationships(currenEntitiesGrouped); + currentEntitiesGrouped = node.RelationshipsFromPreviousLayer.GetRightEntities(); + currentEntitiesGroupedInverse = ReplaceKeysWithInverseRelationships(currentEntitiesGrouped); var resourcesByRelationship = CreateRelationshipHelper(entityType, currentEntitiesGroupedInverse, dbValues); - var allowedIds = CallHook(nestedHookcontainer, ResourceHook.BeforeUpdateRelationship, new object[] { GetIds(uniqueEntities), resourcesByRelationship, pipeline }).Cast(); + var allowedIds = CallHook(nestedHookContainer, ResourceHook.BeforeUpdateRelationship, new object[] { GetIds(uniqueEntities), resourcesByRelationship, pipeline }).Cast(); var updated = GetAllowedEntities(uniqueEntities, allowedIds); node.UpdateUnique(updated); node.Reassign(); @@ -293,20 +293,20 @@ void FireNestedBeforeUpdateHooks(ResourcePipeline pipeline, NodeLayer layer) /// Fire the BeforeImplicitUpdateRelationship hook for article2 /// For this, we need to query the database for the current owner /// relationship value of owner_new. - currenEntitiesGrouped = node.RelationshipsFromPreviousLayer.GetRightEntities(); - if (currenEntitiesGrouped.Any()) + currentEntitiesGrouped = node.RelationshipsFromPreviousLayer.GetRightEntities(); + if (currentEntitiesGrouped.Any()) { /// rightEntities is grouped by relationships from previous /// layer, ie { HasOneAttribute:owner => owner_new }. But /// to load article2 onto owner_new, we need to have the /// RelationshipAttribute from owner to article, which is the /// inverse of HasOneAttribute:owner - currentEntitiesGroupedInverse = ReplaceKeysWithInverseRelationships(currenEntitiesGrouped); + currentEntitiesGroupedInverse = ReplaceKeysWithInverseRelationships(currentEntitiesGrouped); /// Note that currently in the JADNC implementation of hooks, /// the root layer is ALWAYS homogenous, so we safely assume /// that for every relationship to the previous layer, the /// left type is the same. - LeftType leftType = currenEntitiesGrouped.First().Key.LeftType; + LeftType leftType = currentEntitiesGrouped.First().Key.LeftType; FireForAffectedImplicits(leftType, currentEntitiesGroupedInverse, pipeline); } } @@ -347,7 +347,7 @@ void FireForAffectedImplicits(Type entityTypeToInclude, Dictionary /// The collection returned from the hook - /// The pipeine from which the hook was fired + /// The pipeline from which the hook was fired void ValidateHookResponse(IEnumerable returnedList, ResourcePipeline pipeline = 0) { if (pipeline == ResourcePipeline.GetSingle && returnedList.Count() > 1) @@ -410,7 +410,7 @@ Dictionary ReplaceWithDbValues(Dictionary - /// Fitler the source set by removing the entities with id that are not + /// Filter the source set by removing the entities with id that are not /// in . /// HashSet GetAllowedEntities(IEnumerable source, IEnumerable allowedIds) @@ -420,7 +420,7 @@ HashSet GetAllowedEntities(IEnumerable source, IEnumerable /// given the set of , it will load all the - /// values from the database of these entites. + /// values from the database of these entities. /// /// The db values. /// type of the entities to be loaded @@ -442,20 +442,20 @@ IEnumerable LoadDbValues(Type entityType, IEnumerable uniqueEntities, ResourceHo void FireAfterUpdateRelationship(IResourceHookContainer container, INode node, ResourcePipeline pipeline) { - Dictionary currenEntitiesGrouped = node.RelationshipsFromPreviousLayer.GetRightEntities(); + Dictionary currentEntitiesGrouped = node.RelationshipsFromPreviousLayer.GetRightEntities(); /// the relationships attributes in currenEntitiesGrouped will be pointing from a /// resource in the previouslayer to a resource in the current (nested) layer. /// For the nested hook we need to replace these attributes with their inverse. /// See the FireNestedBeforeUpdateHooks method for a more detailed example. - var resourcesByRelationship = CreateRelationshipHelper(node.ResourceType, ReplaceKeysWithInverseRelationships(currenEntitiesGrouped)); + var resourcesByRelationship = CreateRelationshipHelper(node.ResourceType, ReplaceKeysWithInverseRelationships(currentEntitiesGrouped)); CallHook(container, ResourceHook.AfterUpdateRelationship, new object[] { resourcesByRelationship, pipeline }); } /// - /// Returns a list of StringIds from a list of IIdentifiables (). + /// Returns a list of StringIds from a list of IIdentifiable entities (). /// /// The ids. - /// iidentifiable entities. + /// IIdentifiable entities. HashSet GetIds(IEnumerable entities) { return new HashSet(entities.Cast().Select(e => e.StringId)); diff --git a/src/JsonApiDotNetCore/Hooks/Traversal/ChildNode.cs b/src/JsonApiDotNetCore/Hooks/Traversal/ChildNode.cs index 00fec56681..7d9dd0bd30 100644 --- a/src/JsonApiDotNetCore/Hooks/Traversal/ChildNode.cs +++ b/src/JsonApiDotNetCore/Hooks/Traversal/ChildNode.cs @@ -49,10 +49,10 @@ public ChildNode(RelationshipProxy[] nextLayerRelationships, RelationshipsFromPr /// public void UpdateUnique(IEnumerable updated) { - List casted = updated.Cast().ToList(); - foreach (var rpfl in _relationshipsFromPreviousLayer) + List cast = updated.Cast().ToList(); + foreach (var group in _relationshipsFromPreviousLayer) { - rpfl.RightEntities = new HashSet(rpfl.RightEntities.Intersect(casted, _comparer).Cast()); + group.RightEntities = new HashSet(group.RightEntities.Intersect(cast, _comparer).Cast()); } } @@ -63,10 +63,10 @@ public void UpdateUnique(IEnumerable updated) public void Reassign(IEnumerable updated = null) { var unique = (HashSet)UniqueEntities; - foreach (var rfpl in _relationshipsFromPreviousLayer) + foreach (var group in _relationshipsFromPreviousLayer) { - var proxy = rfpl.Proxy; - var leftEntities = rfpl.LeftEntities; + var proxy = group.Proxy; + var leftEntities = group.LeftEntities; foreach (IIdentifiable left in leftEntities) { diff --git a/src/JsonApiDotNetCore/Hooks/Traversal/IEntityNode.cs b/src/JsonApiDotNetCore/Hooks/Traversal/IEntityNode.cs index 2519449325..c610e2cc18 100644 --- a/src/JsonApiDotNetCore/Hooks/Traversal/IEntityNode.cs +++ b/src/JsonApiDotNetCore/Hooks/Traversal/IEntityNode.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCore.Hooks internal interface INode { /// - /// Each node representes the entities of a given type throughout a particular layer. + /// Each node represents the entities of a given type throughout a particular layer. /// RightType ResourceType { get; } /// diff --git a/src/JsonApiDotNetCore/Hooks/Traversal/RelationshipProxy.cs b/src/JsonApiDotNetCore/Hooks/Traversal/RelationshipProxy.cs index 427dbaf2eb..a8c69f4d96 100644 --- a/src/JsonApiDotNetCore/Hooks/Traversal/RelationshipProxy.cs +++ b/src/JsonApiDotNetCore/Hooks/Traversal/RelationshipProxy.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using JsonApiDotNetCore.Extensions; @@ -12,7 +12,7 @@ namespace JsonApiDotNetCore.Hooks /// A wrapper for RelationshipAttribute with an abstraction layer that works on the /// getters and setters of relationships. These are different in the case of /// HasMany vs HasManyThrough, and HasManyThrough. - /// It also depends on if the jointable entity + /// It also depends on if the join table entity /// (eg ArticleTags) is identifiable (in which case we will traverse through /// it and fire hooks for it, if defined) or not (in which case we skip /// ArticleTags and go directly to Tags. @@ -24,9 +24,9 @@ public class RelationshipProxy /// /// The target type for this relationship attribute. - /// For HasOne has HasMany this is trivial: just the righthand side. - /// For HasManyThrough it is either the ThroughProperty (when the jointable is - /// Identifiable) or it is the righthand side (when the jointable is not identifiable) + /// For HasOne has HasMany this is trivial: just the right-hand side. + /// For HasManyThrough it is either the ThroughProperty (when the join table is + /// Identifiable) or it is the right-hand side (when the join table is not identifiable) /// public Type RightType { get; private set; } public Type LeftType { get { return Attribute.LeftType; } } diff --git a/src/JsonApiDotNetCore/Hooks/Traversal/RootNode.cs b/src/JsonApiDotNetCore/Hooks/Traversal/RootNode.cs index 23fc32c8bb..83f485f5a1 100644 --- a/src/JsonApiDotNetCore/Hooks/Traversal/RootNode.cs +++ b/src/JsonApiDotNetCore/Hooks/Traversal/RootNode.cs @@ -40,11 +40,11 @@ public Dictionary LeftsToNextLayer() /// public IRelationshipsFromPreviousLayer RelationshipsFromPreviousLayer { get { return null; } } - public RootNode(IEnumerable uniqueEntities, RelationshipProxy[] poplatedRelationships, RelationshipProxy[] allRelationships) + public RootNode(IEnumerable uniqueEntities, RelationshipProxy[] populatedRelationships, RelationshipProxy[] allRelationships) { ResourceType = typeof(TResource); _uniqueEntities = new HashSet(uniqueEntities); - RelationshipsToNextLayer = poplatedRelationships; + RelationshipsToNextLayer = populatedRelationships; _allRelationshipsToNextLayer = allRelationships; } @@ -54,8 +54,8 @@ public RootNode(IEnumerable uniqueEntities, RelationshipProxy[] popla /// Updated. public void UpdateUnique(IEnumerable updated) { - var casted = updated.Cast().ToList(); - var intersected = _uniqueEntities.Intersect(casted, _comparer).Cast(); + var cast = updated.Cast().ToList(); + var intersected = _uniqueEntities.Intersect(cast, _comparer).Cast(); _uniqueEntities = new HashSet(intersected); } diff --git a/src/JsonApiDotNetCore/Hooks/Traversal/TraversalHelper.cs b/src/JsonApiDotNetCore/Hooks/Traversal/TraversalHelper.cs index 1b8fb9c935..0539226091 100644 --- a/src/JsonApiDotNetCore/Hooks/Traversal/TraversalHelper.cs +++ b/src/JsonApiDotNetCore/Hooks/Traversal/TraversalHelper.cs @@ -110,8 +110,8 @@ public NodeLayer CreateNextLayer(IEnumerable nodes) } /// - /// iterates throug the dictinary and groups the values - /// by matching right type of the keys (which are relationshipattributes) + /// iterates through the dictionary and groups the values + /// by matching right type of the keys (which are relationship attributes) /// Dictionary>>> GroupByRightTypeOfRelationship(Dictionary> relationships) { @@ -124,8 +124,8 @@ Dictionary>> /// (Dictionary>, Dictionary>) ExtractEntities(IEnumerable leftNodes) { - var leftEntitiesGrouped = new Dictionary>(); // RelationshipAttr_prevlayer->currentlayer => prevLayerEntities - var rightEntitiesGrouped = new Dictionary>(); // RelationshipAttr_prevlayer->currentlayer => currentLayerEntities + var leftEntitiesGrouped = new Dictionary>(); // RelationshipAttr_prevLayer->currentLayer => prevLayerEntities + var rightEntitiesGrouped = new Dictionary>(); // RelationshipAttr_prevLayer->currentLayer => currentLayerEntities foreach (var node in leftNodes) { @@ -256,9 +256,9 @@ HashSet UniqueInTree(IEnumerable entities, Type /// /// Gets the type from relationship attribute. If the attribute is - /// HasManyThrough, and the jointable entity is identifiable, then the target - /// type is the joinentity instead of the righthand side, because hooks might be - /// implemented for the jointable entity. + /// HasManyThrough, and the join table entity is identifiable, then the target + /// type is the join entity instead of the right-hand side, because hooks might be + /// implemented for the join table entity. /// /// The target type for traversal /// Relationship attribute @@ -295,8 +295,8 @@ INode CreateNodeInstance(RightType nodeType, RelationshipProxy[] relationshipsTo /// IRelationshipsFromPreviousLayer CreateRelationshipsFromInstance(RightType nodeType, IEnumerable relationshipsFromPrev) { - var casted = relationshipsFromPrev.Cast(relationshipsFromPrev.First().GetType()); - return (IRelationshipsFromPreviousLayer)TypeHelper.CreateInstanceOfOpenType(typeof(RelationshipsFromPreviousLayer<>), nodeType, new object[] { casted }); + var cast = relationshipsFromPrev.Cast(relationshipsFromPrev.First().GetType()); + return (IRelationshipsFromPreviousLayer)TypeHelper.CreateInstanceOfOpenType(typeof(RelationshipsFromPreviousLayer<>), nodeType, new object[] { cast }); } /// diff --git a/src/JsonApiDotNetCore/Internal/Contracts/IResourceGraphExplorer.cs b/src/JsonApiDotNetCore/Internal/Contracts/IResourceGraphExplorer.cs index 4768e3744c..9a21c6a726 100644 --- a/src/JsonApiDotNetCore/Internal/Contracts/IResourceGraphExplorer.cs +++ b/src/JsonApiDotNetCore/Internal/Contracts/IResourceGraphExplorer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq.Expressions; using JsonApiDotNetCore.Models; @@ -25,7 +25,7 @@ public interface IResourceGraph : IResourceContextProvider /// exposed fields are returned. /// /// The resource for which to retrieve attributes - /// Should be of the form: (TResource e) => new { e.Attribute1, e.Arttribute2 } + /// Should be of the form: (TResource e) => new { e.Attribute1, e.Attribute2 } List GetAttributes(Expression> selector = null) where TResource : IIdentifiable; /// /// Gets all relationships for diff --git a/src/JsonApiDotNetCore/Internal/Generics/RepositoryRelationshipUpdateHelper.cs b/src/JsonApiDotNetCore/Internal/Generics/RepositoryRelationshipUpdateHelper.cs index ec4a4f0bbb..a20827381a 100644 --- a/src/JsonApiDotNetCore/Internal/Generics/RepositoryRelationshipUpdateHelper.cs +++ b/src/JsonApiDotNetCore/Internal/Generics/RepositoryRelationshipUpdateHelper.cs @@ -79,8 +79,8 @@ private async Task UpdateOneToManyAsync(IIdentifiable parent, RelationshipAttrib Expression idMember = Expression.Property(parameter, nameof(Identifiable.Id)); // [1,2,3].Contains(p.Id) var callContains = Expression.Call(typeof(Enumerable), nameof(Enumerable.Contains), new[] { idMember.Type }, target, idMember); - var containsLamdda = Expression.Lambda>(callContains, parameter); - value = await _context.Set().Where(containsLamdda).ToListAsync(); + var containsLambda = Expression.Lambda>(callContains, parameter); + value = await _context.Set().Where(containsLambda).ToListAsync(); } relationship.SetValue(parent, value); } diff --git a/src/JsonApiDotNetCore/Internal/IControllerResourceMapping.cs b/src/JsonApiDotNetCore/Internal/IControllerResourceMapping.cs index 347a85650c..47a078c94c 100644 --- a/src/JsonApiDotNetCore/Internal/IControllerResourceMapping.cs +++ b/src/JsonApiDotNetCore/Internal/IControllerResourceMapping.cs @@ -1,9 +1,9 @@ -using System; +using System; namespace JsonApiDotNetCore.Internal { /// - /// Registery of which resource is associated with which controller. + /// Registry of which resource is associated with which controller. /// public interface IControllerResourceMapping { @@ -12,4 +12,4 @@ public interface IControllerResourceMapping /// Type GetAssociatedResource(string controllerName); } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Internal/TypeHelper.cs b/src/JsonApiDotNetCore/Internal/TypeHelper.cs index e5938472c1..47b6a8a1cb 100644 --- a/src/JsonApiDotNetCore/Internal/TypeHelper.cs +++ b/src/JsonApiDotNetCore/Internal/TypeHelper.cs @@ -88,14 +88,14 @@ public static Type GetTypeOfList(Type type) } /// - /// Gets the property info that is referenced in the NavigatioAction expression. + /// Gets the property info that is referenced in the NavigationAction expression. /// Credits: https://stackoverflow.com/a/17116267/4441216 /// public static PropertyInfo ParseNavigationExpression(Expression> NavigationExpression) { MemberExpression Exp = null; - //this line is necessary, because sometimes the expression comes in as Convert(originalexpression) + //this line is necessary, because sometimes the expression comes in as Convert(originalExpression) if (NavigationExpression.Body is UnaryExpression) { var UnExp = (UnaryExpression)NavigationExpression.Body; diff --git a/src/JsonApiDotNetCore/Models/Annotation/HasManyAttribute.cs b/src/JsonApiDotNetCore/Models/Annotation/HasManyAttribute.cs index 7a05dd8fe4..a283beb495 100644 --- a/src/JsonApiDotNetCore/Models/Annotation/HasManyAttribute.cs +++ b/src/JsonApiDotNetCore/Models/Annotation/HasManyAttribute.cs @@ -20,7 +20,7 @@ public class HasManyAttribute : RelationshipAttribute /// public class Author : Identifiable /// { /// [HasMany("articles"] - /// public virtual List<Articl> Articles { get; set; } + /// public virtual List<Article> Articles { get; set; } /// } /// /// diff --git a/src/JsonApiDotNetCore/Models/ResourceDefinition.cs b/src/JsonApiDotNetCore/Models/ResourceDefinition.cs index 6f7798e484..6983cba452 100644 --- a/src/JsonApiDotNetCore/Models/ResourceDefinition.cs +++ b/src/JsonApiDotNetCore/Models/ResourceDefinition.cs @@ -46,7 +46,7 @@ public ResourceDefinition(IResourceGraph resourceGraph) /// Hides specified attributes and relationships from the serialized output. Can be called directly in a resource definition implementation or /// in any resource hook to combine it with eg authorization. /// - /// Should be of the form: (TResource e) => new { e.Attribute1, e.Arttribute2, e.Relationship1, e.Relationship2 } + /// Should be of the form: (TResource e) => new { e.Attribute1, e.Attribute2, e.Relationship1, e.Relationship2 } public void HideFields(Expression> selector) { var fieldsToHide = _resourceGraph.GetFields(selector); diff --git a/src/JsonApiDotNetCore/QueryParameterServices/Common/QueryParameterService.cs b/src/JsonApiDotNetCore/QueryParameterServices/Common/QueryParameterService.cs index 577040a24e..cf363bef65 100644 --- a/src/JsonApiDotNetCore/QueryParameterServices/Common/QueryParameterService.cs +++ b/src/JsonApiDotNetCore/QueryParameterServices/Common/QueryParameterService.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Text.RegularExpressions; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Internal.Contracts; @@ -8,7 +8,7 @@ namespace JsonApiDotNetCore.Query { /// - /// Base clas for query parameters. + /// Base class for query parameters. /// public abstract class QueryParameterService { diff --git a/src/JsonApiDotNetCore/QueryParameterServices/SparseFieldsService.cs b/src/JsonApiDotNetCore/QueryParameterServices/SparseFieldsService.cs index 20b52a079e..c56319fe93 100644 --- a/src/JsonApiDotNetCore/QueryParameterServices/SparseFieldsService.cs +++ b/src/JsonApiDotNetCore/QueryParameterServices/SparseFieldsService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using JsonApiDotNetCore.Internal; @@ -49,18 +49,18 @@ public virtual void Parse(KeyValuePair queryParameter) var fields = new List { nameof(Identifiable.Id) }; fields.AddRange(((string)queryParameter.Value).Split(QueryConstants.COMMA)); - var keySplitted = queryParameter.Key.Split(QueryConstants.OPEN_BRACKET, QueryConstants.CLOSE_BRACKET); + var keySplit = queryParameter.Key.Split(QueryConstants.OPEN_BRACKET, QueryConstants.CLOSE_BRACKET); - if (keySplitted.Count() == 1) + if (keySplit.Count() == 1) { // input format: fields=prop1,prop2 foreach (var field in fields) RegisterRequestResourceField(field); } else { // input format: fields[articles]=prop1,prop2 - string navigation = keySplitted[1]; + string navigation = keySplit[1]; // it is possible that the request resource has a relationship - // that is equal to the resource name, like with self-referering data types (eg directory structures) + // that is equal to the resource name, like with self-referencing data types (eg directory structures) // if not, no longer support this type of sparse field selection. if (navigation == _requestResource.ResourceName && !_requestResource.Relationships.Any(a => a.Is(navigation))) throw new JsonApiException(400, $"Use '?fields=...' instead of 'fields[{navigation}]':" + diff --git a/src/JsonApiDotNetCore/Serialization/Client/IRequestSerializer.cs b/src/JsonApiDotNetCore/Serialization/Client/IRequestSerializer.cs index d4a86702ec..39dbc5f805 100644 --- a/src/JsonApiDotNetCore/Serialization/Client/IRequestSerializer.cs +++ b/src/JsonApiDotNetCore/Serialization/Client/IRequestSerializer.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.Linq.Expressions; using JsonApiDotNetCore.Models; @@ -13,7 +13,7 @@ namespace JsonApiDotNetCore.Serialization.Client public interface IRequestSerializer { /// - /// Creates and serializes a document for a single intance of a resource. + /// Creates and serializes a document for a single instance of a resource. /// /// Entity to serialize /// The serialized content @@ -37,4 +37,4 @@ public interface IRequestSerializer /// public IEnumerable RelationshipsToSerialize { set; } } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Serialization/Client/IResponseDeserializer.cs b/src/JsonApiDotNetCore/Serialization/Client/IResponseDeserializer.cs index 3cd4497c15..c40a07e8a2 100644 --- a/src/JsonApiDotNetCore/Serialization/Client/IResponseDeserializer.cs +++ b/src/JsonApiDotNetCore/Serialization/Client/IResponseDeserializer.cs @@ -1,10 +1,10 @@ -using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models; namespace JsonApiDotNetCore.Serialization.Client { /// /// Client deserializer. Currently not used internally in JsonApiDotNetCore, - /// except for in the tests. Exposed pubically to make testing easier or to implement + /// except for in the tests. Exposed publicly to make testing easier or to implement /// server-to-server communication. /// public interface IResponseDeserializer @@ -23,4 +23,4 @@ public interface IResponseDeserializer /// The JSON to be deserialized DeserializedListResponse DeserializeList(string body) where TResource : class, IIdentifiable; } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Serialization/Client/ResponseDeserializer.cs b/src/JsonApiDotNetCore/Serialization/Client/ResponseDeserializer.cs index b5446325ad..38ed9dd1f0 100644 --- a/src/JsonApiDotNetCore/Serialization/Client/ResponseDeserializer.cs +++ b/src/JsonApiDotNetCore/Serialization/Client/ResponseDeserializer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using JsonApiDotNetCore.Extensions; @@ -44,7 +44,7 @@ public DeserializedListResponse DeserializeList(string bod } /// - /// Additional procesing required for client deserialization, responsible + /// Additional processing required for client deserialization, responsible /// for parsing the property. When a relationship value is parsed, /// it goes through the included list to set its attributes and relationships. /// diff --git a/src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs b/src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs index ede8418eed..750434b4aa 100644 --- a/src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs +++ b/src/JsonApiDotNetCore/Serialization/Common/BaseDocumentParser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -32,7 +32,7 @@ protected BaseDocumentParser(IResourceContextProvider provider) /// depending on the type of deserializers. /// /// - /// See the impementation of this method in + /// See the implementation of this method in /// and for examples. /// /// The entity that was constructed from the document's body @@ -86,7 +86,7 @@ protected IIdentifiable SetAttributes(IIdentifiable entity, Dictionary /// The parsed entity /// Relationships and their values, as in the serialized content - /// Exposed relatinships for + /// Exposed relationships for /// protected IIdentifiable SetRelationships(IIdentifiable entity, Dictionary relationshipsValues, List relationshipAttributes) { @@ -193,7 +193,7 @@ private void SetForeignKey(IIdentifiable entity, PropertyInfo foreignKey, HasOne || foreignKey.PropertyType == typeof(string); if (id == null && !foreignKeyPropertyIsNullableType) { - // this happens when a non-optional relationship is deliberatedly set to null. + // this happens when a non-optional relationship is deliberately set to null. // For a server deserializer, it should be mapped to a BadRequest HTTP error code. throw new FormatException($"Cannot set required relationship identifier '{attr.IdentifiablePropertyName}' to null because it is a non-nullable type."); } diff --git a/src/JsonApiDotNetCore/Serialization/Server/Builders/IncludedResourceObjectBuilder.cs b/src/JsonApiDotNetCore/Serialization/Server/Builders/IncludedResourceObjectBuilder.cs index 4ce2aa5f94..2dd9219a25 100644 --- a/src/JsonApiDotNetCore/Serialization/Server/Builders/IncludedResourceObjectBuilder.cs +++ b/src/JsonApiDotNetCore/Serialization/Server/Builders/IncludedResourceObjectBuilder.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.Linq; using JsonApiDotNetCore.Builders; diff --git a/src/JsonApiDotNetCore/Serialization/Server/Builders/ResponseResourceObjectBuilder.cs b/src/JsonApiDotNetCore/Serialization/Server/Builders/ResponseResourceObjectBuilder.cs index fadc819581..230aed4372 100644 --- a/src/JsonApiDotNetCore/Serialization/Server/Builders/ResponseResourceObjectBuilder.cs +++ b/src/JsonApiDotNetCore/Serialization/Server/Builders/ResponseResourceObjectBuilder.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using JsonApiDotNetCore.Internal.Contracts; using JsonApiDotNetCore.Models; @@ -54,7 +54,7 @@ protected override RelationshipEntry GetRelationshipData(RelationshipAttribute r var links = _linkBuilder.GetRelationshipLinks(relationship, entity); if (links != null) - // if links relationshiplinks should be built for this entry, populate the "links" field. + // if links relationshipLinks should be built for this entry, populate the "links" field. (relationshipEntry = relationshipEntry ?? new RelationshipEntry()).Links = links; /// if neither "links" nor "data" was popupated, return null, which will omit this entry from the output. diff --git a/src/JsonApiDotNetCore/Serialization/Server/Contracts/IIncludedResourceObjectBuilder.cs b/src/JsonApiDotNetCore/Serialization/Server/Contracts/IIncludedResourceObjectBuilder.cs index 9bd77ec1d6..fdaace9d28 100644 --- a/src/JsonApiDotNetCore/Serialization/Server/Contracts/IIncludedResourceObjectBuilder.cs +++ b/src/JsonApiDotNetCore/Serialization/Server/Contracts/IIncludedResourceObjectBuilder.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using JsonApiDotNetCore.Models; namespace JsonApiDotNetCore.Serialization.Server.Builders @@ -11,8 +11,8 @@ public interface IIncludedResourceObjectBuilder List Build(); /// /// Extracts the included entities from using the - /// (arbitrarly deeply nested) included relationships in . + /// (arbitrarily deeply nested) included relationships in . /// void IncludeRelationshipChain(List inclusionChain, IIdentifiable rootEntity); } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Serialization/Server/FieldsToSerialize.cs b/src/JsonApiDotNetCore/Serialization/Server/FieldsToSerialize.cs index 4bdf99654a..8991113311 100644 --- a/src/JsonApiDotNetCore/Serialization/Server/FieldsToSerialize.cs +++ b/src/JsonApiDotNetCore/Serialization/Server/FieldsToSerialize.cs @@ -1,4 +1,4 @@ -using JsonApiDotNetCore.Internal.Contracts; +using JsonApiDotNetCore.Internal.Contracts; using System; using System.Collections.Generic; using JsonApiDotNetCore.Query; @@ -25,12 +25,12 @@ public FieldsToSerialize(IResourceGraph resourceGraph, /// public List GetAllowedAttributes(Type type, RelationshipAttribute relationship = null) - { // get the list of all exposed atttributes for the given type. + { // get the list of all exposed attributes for the given type. var allowed = _resourceGraph.GetAttributes(type); var resourceDefinition = _provider.Get(type); if (resourceDefinition != null) - // The set of allowed attribrutes to be exposed was defined on the resource definition + // The set of allowed attributes to be exposed was defined on the resource definition allowed = allowed.Intersect(resourceDefinition.GetAllowedAttributes()).ToList(); var sparseFieldsSelection = _sparseFieldsService.Get(relationship); @@ -52,10 +52,10 @@ public List GetAllowedRelationships(Type type) { var resourceDefinition = _provider.Get(type); if (resourceDefinition != null) - // The set of allowed attribrutes to be exposed was defined on the resource definition + // The set of allowed attributes to be exposed was defined on the resource definition return resourceDefinition.GetAllowedRelationships(); - // The set of allowed attribrutes to be exposed was NOT defined on the resource definition: return all + // The set of allowed attributes to be exposed was NOT defined on the resource definition: return all return _resourceGraph.GetRelationships(type); } } diff --git a/src/JsonApiDotNetCore/Serialization/Server/RequestDeserializer.cs b/src/JsonApiDotNetCore/Serialization/Server/RequestDeserializer.cs index 441f873bd1..8e28d04c16 100644 --- a/src/JsonApiDotNetCore/Serialization/Server/RequestDeserializer.cs +++ b/src/JsonApiDotNetCore/Serialization/Server/RequestDeserializer.cs @@ -1,4 +1,4 @@ -using System; +using System; using JsonApiDotNetCore.Internal.Contracts; using JsonApiDotNetCore.Models; @@ -24,7 +24,7 @@ public RequestDeserializer(IResourceContextProvider provider, } /// - /// Additional procesing required for server deserialization. Flags a + /// Additional processing required for server deserialization. Flags a /// processed attribute or relationship as updated using . /// /// The entity that was constructed from the document's body diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs index e5a2ba0a8e..0fbace3280 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/ResourceDefinitionTests.cs @@ -269,7 +269,7 @@ public async Task Tag_Is_Hidden() ///// its foreign key. ///// [Fact] - public async Task Cascade_Permission_Error__Create_ToOne_Relationship() + public async Task Cascade_Permission_Error_Create_ToOne_Relationship() { // Arrange var context = _fixture.GetService(); @@ -315,7 +315,7 @@ public async Task Cascade_Permission_Error__Create_ToOne_Relationship() [Fact] - public async Task Cascade_Permission_Error__Updating_ToOne_Relationship() + public async Task Cascade_Permission_Error_Updating_ToOne_Relationship() { // Arrange var context = _fixture.GetService(); @@ -362,7 +362,7 @@ public async Task Cascade_Permission_Error__Updating_ToOne_Relationship() } [Fact] - public async Task Cascade_Permission_Error__Updating_ToOne_Relationship_Deletion() + public async Task Cascade_Permission_Error_Updating_ToOne_Relationship_Deletion() { // Arrange var context = _fixture.GetService(); @@ -411,7 +411,7 @@ public async Task Cascade_Permission_Error__Updating_ToOne_Relationship_Deletion [Fact] - public async Task Cascade_Permission_Error__Delete_ToOne_Relationship() + public async Task Cascade_Permission_Error_Delete_ToOne_Relationship() { // Arrange var context = _fixture.GetService(); @@ -437,7 +437,7 @@ public async Task Cascade_Permission_Error__Delete_ToOne_Relationship() [Fact] - public async Task Cascade_Permission_Error__Create_ToMany_Relationship() + public async Task Cascade_Permission_Error_Create_ToMany_Relationship() { // Arrange var context = _fixture.GetService(); @@ -486,7 +486,7 @@ public async Task Cascade_Permission_Error__Create_ToMany_Relationship() } [Fact] - public async Task Cascade_Permission_Error__Updating_ToMany_Relationship() + public async Task Cascade_Permission_Error_Updating_ToMany_Relationship() { // Arrange var context = _fixture.GetService(); @@ -541,7 +541,7 @@ public async Task Cascade_Permission_Error__Updating_ToMany_Relationship() } [Fact] - public async Task Cascade_Permission_Error__Delete_ToMany_Relationship() + public async Task Cascade_Permission_Error_Delete_ToMany_Relationship() { // Arrange var context = _fixture.GetService(); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs index 51f10bf1d8..b5a0ef5140 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs @@ -31,7 +31,7 @@ public CreatingDataTests(StandardApplicationFactory factory) : base(factory) } [Fact] - public async Task CreateResource_ModelWithEntityFrameworkInHeritance_IsCreated() + public async Task CreateResource_ModelWithEntityFrameworkInheritance_IsCreated() { // Arrange var serializer = GetSerializer(e => new { e.SecurityLevel, e.Username, e.Password }); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs index ac73ca9c4f..5c98837e1d 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs @@ -41,7 +41,7 @@ public Included(TestFixture fixture) } [Fact] - public async Task GET_Included_Contains_SideloadeData_ForManyToOne() + public async Task GET_Included_Contains_SideLoadedData_ForManyToOne() { // Arrange var person = _personFaker.Generate(); @@ -79,7 +79,7 @@ public async Task GET_Included_Contains_SideloadeData_ForManyToOne() } [Fact] - public async Task GET_ById_Included_Contains_SideloadeData_ForManyToOne() + public async Task GET_ById_Included_Contains_SideLoadedData_ForManyToOne() { // Arrange var person = _personFaker.Generate(); @@ -117,7 +117,7 @@ public async Task GET_ById_Included_Contains_SideloadeData_ForManyToOne() } [Fact] - public async Task GET_Included_Contains_SideloadeData_OneToMany() + public async Task GET_Included_Contains_SideLoadedData_OneToMany() { // Arrange _context.People.RemoveRange(_context.People); // ensure all people have todoItems diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs index 4c85d5bd99..a3acd23ce2 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs @@ -218,7 +218,7 @@ public async Task Fields_Query_Selects_Fieldset_With_HasOne() // Act var response = await client.SendAsync(request); - // Assert - check statusc ode + // Assert - check status code Assert.Equal(HttpStatusCode.OK, response.StatusCode); var body = await response.Content.ReadAsStringAsync(); var deserializeBody = JsonConvert.DeserializeObject(body); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs index 1e9a3d1643..e3d8b10714 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs @@ -42,7 +42,7 @@ public UpdatingDataTests(TestFixture fixture) : base(fixture) } [Fact] - public async Task PatchResource_ModelWithEntityFrameworkInHeritance_IsPatched() + public async Task PatchResource_ModelWithEntityFrameworkInheritance_IsPatched() { // Arrange var dbContext = PrepareTest(); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs index c21e8f3b0c..e3c9c9e3f4 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; diff --git a/test/JsonApiDotNetCoreExampleTests/Helpers/Models/TodoItemClient.cs b/test/JsonApiDotNetCoreExampleTests/Helpers/Models/TodoItemClient.cs index ae15c5d7b2..afe60c0fe7 100644 --- a/test/JsonApiDotNetCoreExampleTests/Helpers/Models/TodoItemClient.cs +++ b/test/JsonApiDotNetCoreExampleTests/Helpers/Models/TodoItemClient.cs @@ -8,7 +8,7 @@ namespace JsonApiDotNetCoreExampleTests.Helpers.Models /// /// this "client" version of the is required because the /// base property that is overridden here does not have a setter. For a model - /// defind on a json:api client, it would not make sense to have an exposed attribute + /// defined on a json:api client, it would not make sense to have an exposed attribute /// without a setter. /// public class TodoItemClient : TodoItem diff --git a/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs b/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs index 06a95fd5e2..fb13bb803c 100644 --- a/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs +++ b/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs @@ -157,7 +157,7 @@ public async Task PatchAsync_Calls_Service() } [Fact] - public async Task PatchAsync_ModelStateInvalid_ValidateModelStateDisbled() + public async Task PatchAsync_ModelStateInvalid_ValidateModelStateDisabled() { // Arrange const int id = 0; diff --git a/test/UnitTests/Graph/TypeLocator_Tests.cs b/test/UnitTests/Graph/TypeLocator_Tests.cs index 4c727b0253..ca70b32581 100644 --- a/test/UnitTests/Graph/TypeLocator_Tests.cs +++ b/test/UnitTests/Graph/TypeLocator_Tests.cs @@ -82,26 +82,26 @@ public void GetIdType_Correctly_Identifies_NonJsonApiResource() } [Fact] - public void GetIdentifableTypes_Locates_Identifiable_Resource() + public void GetIdentifiableTypes_Locates_Identifiable_Resource() { // Arrange var resourceType = typeof(Model); // Act - var results = TypeLocator.GetIdentifableTypes(resourceType.Assembly); + var results = TypeLocator.GetIdentifiableTypes(resourceType.Assembly); // Assert Assert.Contains(results, r => r.ResourceType == resourceType); } [Fact] - public void GetIdentifableTypes__Only_Contains_IIdentifiable_Types() + public void GetIdentifiableTypes_Only_Contains_IIdentifiable_Types() { // Arrange var resourceType = typeof(Model); // Act - var resourceDescriptors = TypeLocator.GetIdentifableTypes(resourceType.Assembly); + var resourceDescriptors = TypeLocator.GetIdentifiableTypes(resourceType.Assembly); // Assert foreach(var resourceDescriptor in resourceDescriptors) @@ -109,7 +109,7 @@ public void GetIdentifableTypes__Only_Contains_IIdentifiable_Types() } [Fact] - public void TryGetResourceDescriptor_Returns_True_If_Type_Is_IIdentfiable() + public void TryGetResourceDescriptor_Returns_True_If_Type_Is_IIdentifiable() { // Arrange var resourceType = typeof(Model); @@ -124,7 +124,7 @@ public void TryGetResourceDescriptor_Returns_True_If_Type_Is_IIdentfiable() } [Fact] - public void TryGetResourceDescriptor_Returns_False_If_Type_Is_IIdentfiable() + public void TryGetResourceDescriptor_Returns_False_If_Type_Is_IIdentifiable() { // Arrange var resourceType = typeof(String); diff --git a/test/UnitTests/Middleware/CurrentRequestMiddlewareTests.cs b/test/UnitTests/Middleware/CurrentRequestMiddlewareTests.cs index 99238d30ed..c224207a5d 100644 --- a/test/UnitTests/Middleware/CurrentRequestMiddlewareTests.cs +++ b/test/UnitTests/Middleware/CurrentRequestMiddlewareTests.cs @@ -101,14 +101,14 @@ class InvokeConfiguration { public CurrentRequestMiddleware MiddleWare; public HttpContext HttpContext; - public Mock ControllerResourcemapping; + public Mock ControllerResourceMapping; public Mock Options; public CurrentRequest CurrentRequest; public Mock ResourceGraph; } private Task RunMiddlewareTask(InvokeConfiguration holder) { - var controllerResourceMapping = holder.ControllerResourcemapping.Object; + var controllerResourceMapping = holder.ControllerResourceMapping.Object; var context = holder.HttpContext; var options = holder.Options.Object; var currentRequest = holder.CurrentRequest; @@ -141,7 +141,7 @@ private InvokeConfiguration GetConfiguration(string path, string resourceName = return new InvokeConfiguration { MiddleWare = middleware, - ControllerResourcemapping = mockMapping, + ControllerResourceMapping = mockMapping, Options = mockOptions, CurrentRequest = currentRequest, HttpContext = context, diff --git a/test/UnitTests/Models/AttributesEqualsTests.cs b/test/UnitTests/Models/AttributesEqualsTests.cs index 05609bee8a..297216db61 100644 --- a/test/UnitTests/Models/AttributesEqualsTests.cs +++ b/test/UnitTests/Models/AttributesEqualsTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using JsonApiDotNetCore.Models; using Xunit; @@ -61,7 +61,7 @@ public void AttrAttribute_Equals_Returns_False_When_Different_Name() } [Fact] - public void HasManyAttribute_Doesnt_Equal_HasOneAttribute_With_Same_Name() + public void HasManyAttribute_Does_Not_Equal_HasOneAttribute_With_Same_Name() { RelationshipAttribute a = new HasManyAttribute("test"); RelationshipAttribute b = new HasOneAttribute("test"); diff --git a/test/UnitTests/ResourceHooks/AffectedEntitiesHelperTests.cs b/test/UnitTests/ResourceHooks/AffectedEntitiesHelperTests.cs index ec748a8308..972442b155 100644 --- a/test/UnitTests/ResourceHooks/AffectedEntitiesHelperTests.cs +++ b/test/UnitTests/ResourceHooks/AffectedEntitiesHelperTests.cs @@ -89,9 +89,9 @@ public void RelationshipsDictionary_GetAffected() var affectedThroughToMany = relationshipsDictionary.GetAffected(d => d.ToManies).ToList(); // Assert - affectedThroughFirstToOne.ForEach((entitiy) => Assert.Contains(entitiy, FirstToOnesEntities)); - affectedThroughSecondToOne.ForEach((entitiy) => Assert.Contains(entitiy, SecondToOnesEntities)); - affectedThroughToMany.ForEach((entitiy) => Assert.Contains(entitiy, ToManiesEntities)); + affectedThroughFirstToOne.ForEach((entity) => Assert.Contains(entity, FirstToOnesEntities)); + affectedThroughSecondToOne.ForEach((entity) => Assert.Contains(entity, SecondToOnesEntities)); + affectedThroughToMany.ForEach((entity) => Assert.Contains(entity, ToManiesEntities)); } [Fact] @@ -178,9 +178,9 @@ public void EntityDiff_GetAffected_Relationships() var affectedThroughToMany = diffs.GetAffected(d => d.ToManies).ToList(); // Assert - affectedThroughFirstToOne.ForEach((entitiy) => Assert.Contains(entitiy, FirstToOnesEntities)); - affectedThroughSecondToOne.ForEach((entitiy) => Assert.Contains(entitiy, SecondToOnesEntities)); - affectedThroughToMany.ForEach((entitiy) => Assert.Contains(entitiy, ToManiesEntities)); + affectedThroughFirstToOne.ForEach((entity) => Assert.Contains(entity, FirstToOnesEntities)); + affectedThroughSecondToOne.ForEach((entity) => Assert.Contains(entity, SecondToOnesEntities)); + affectedThroughToMany.ForEach((entity) => Assert.Contains(entity, ToManiesEntities)); } [Fact] @@ -213,9 +213,9 @@ private void AssertRelationshipDictionaryGetters(Dictionary + toOnes[FirstToOneAttr].ToList().ForEach((entity) => { - Assert.Contains(entitiy, FirstToOnesEntities); + Assert.Contains(entity, FirstToOnesEntities); }); toOnes[SecondToOneAttr].ToList().ForEach((entity) => @@ -223,9 +223,9 @@ private void AssertRelationshipDictionaryGetters(Dictionary + toManies[ToManyAttr].ToList().ForEach((entity) => { - Assert.Contains(entitiy, ToManiesEntities); + Assert.Contains(entity, ToManiesEntities); }); Assert.Empty(notTargeted); } diff --git a/test/UnitTests/ResourceHooks/DiscoveryTests.cs b/test/UnitTests/ResourceHooks/DiscoveryTests.cs index 72e581aa6f..1ff192f691 100644 --- a/test/UnitTests/ResourceHooks/DiscoveryTests.cs +++ b/test/UnitTests/ResourceHooks/DiscoveryTests.cs @@ -39,14 +39,14 @@ public void HookDiscovery_StandardResourceDefinition_CanDiscover() } public class AnotherDummy : Identifiable { } - public abstract class ResourceDefintionBase : ResourceDefinition where T : class, IIdentifiable + public abstract class ResourceDefinitionBase : ResourceDefinition where T : class, IIdentifiable { - public ResourceDefintionBase(IResourceGraph resourceGraph) : base(resourceGraph) { } + public ResourceDefinitionBase(IResourceGraph resourceGraph) : base(resourceGraph) { } public override IEnumerable BeforeDelete(IEntityHashSet entities, ResourcePipeline pipeline) { return entities; } public override void AfterDelete(HashSet entities, ResourcePipeline pipeline, bool succeeded) { } } - public class AnotherDummyResourceDefinition : ResourceDefintionBase + public class AnotherDummyResourceDefinition : ResourceDefinitionBase { public AnotherDummyResourceDefinition() : base(new ResourceGraphBuilder().AddResource().Build()) { } } diff --git a/test/UnitTests/ResourceHooks/ResourceHookExecutor/Delete/BeforeDelete_WithDbValue_Tests.cs b/test/UnitTests/ResourceHooks/ResourceHookExecutor/Delete/BeforeDelete_WithDbValue_Tests.cs index 07f59ec219..0873aee1c9 100644 --- a/test/UnitTests/ResourceHooks/ResourceHookExecutor/Delete/BeforeDelete_WithDbValue_Tests.cs +++ b/test/UnitTests/ResourceHooks/ResourceHookExecutor/Delete/BeforeDelete_WithDbValue_Tests.cs @@ -1,4 +1,4 @@ -using JsonApiDotNetCore.Hooks; +using JsonApiDotNetCore.Hooks; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; using Microsoft.EntityFrameworkCore; diff --git a/test/UnitTests/ResourceHooks/ResourceHookExecutor/IdentifiableManyToMany_OnReturnTests.cs b/test/UnitTests/ResourceHooks/ResourceHookExecutor/IdentifiableManyToMany_OnReturnTests.cs index c55ad233c9..562a65598d 100644 --- a/test/UnitTests/ResourceHooks/ResourceHookExecutor/IdentifiableManyToMany_OnReturnTests.cs +++ b/test/UnitTests/ResourceHooks/ResourceHookExecutor/IdentifiableManyToMany_OnReturnTests.cs @@ -139,7 +139,7 @@ public void OnReturn_Without_Any_Hook_Implemented() // Act hookExecutor.OnReturn(articles, ResourcePipeline.Get); - // asert + // Assert VerifyNoOtherCalls(articleResourceMock, joinResourceMock, tagResourceMock); } } diff --git a/test/UnitTests/ResourceHooks/ResourceHookExecutor/ManyToMany_OnReturnTests.cs b/test/UnitTests/ResourceHooks/ResourceHookExecutor/ManyToMany_OnReturnTests.cs index 963b4ce073..cb99e26b93 100644 --- a/test/UnitTests/ResourceHooks/ResourceHookExecutor/ManyToMany_OnReturnTests.cs +++ b/test/UnitTests/ResourceHooks/ResourceHookExecutor/ManyToMany_OnReturnTests.cs @@ -71,7 +71,7 @@ public void OnReturn_Without_Parent_Hook_Implemented() // Act hookExecutor.OnReturn(articles, ResourcePipeline.Get); - // asser + // Assert tagResourceMock.Verify(rd => rd.OnReturn(It.Is>((collection) => !collection.Except(tags).Any()), ResourcePipeline.Get), Times.Once()); VerifyNoOtherCalls(articleResourceMock, tagResourceMock); } diff --git a/test/UnitTests/ResourceHooks/ResourceHookExecutor/Read/IdentifiableManyToMany_AfterReadTests.cs b/test/UnitTests/ResourceHooks/ResourceHookExecutor/Read/IdentifiableManyToMany_AfterReadTests.cs index e8bb6a5f0a..1f7f5f678f 100644 --- a/test/UnitTests/ResourceHooks/ResourceHookExecutor/Read/IdentifiableManyToMany_AfterReadTests.cs +++ b/test/UnitTests/ResourceHooks/ResourceHookExecutor/Read/IdentifiableManyToMany_AfterReadTests.cs @@ -121,7 +121,7 @@ public void AfterRead_Without_Any_Hook_Implemented() // Act hookExecutor.AfterRead(articles, ResourcePipeline.Get); - // asert + // Assert VerifyNoOtherCalls(articleResourceMock, joinResourceMock, tagResourceMock); } } diff --git a/test/UnitTests/ResourceHooks/ResourceHookExecutor/Update/BeforeUpdate_WithDbValues_Tests.cs b/test/UnitTests/ResourceHooks/ResourceHookExecutor/Update/BeforeUpdate_WithDbValues_Tests.cs index ed145f23b3..156aa3c99a 100644 --- a/test/UnitTests/ResourceHooks/ResourceHookExecutor/Update/BeforeUpdate_WithDbValues_Tests.cs +++ b/test/UnitTests/ResourceHooks/ResourceHookExecutor/Update/BeforeUpdate_WithDbValues_Tests.cs @@ -1,4 +1,4 @@ -using JsonApiDotNetCore.Hooks; +using JsonApiDotNetCore.Hooks; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; using Microsoft.EntityFrameworkCore; @@ -207,11 +207,11 @@ private bool TodoCheckDiff(IDiffableEntityHashSet entities, string che var diffPairCheck = (dbCheck && reqCheck); var updatedRelationship = entities.GetByRelationship().Single(); - var diffcheck = updatedRelationship.Key.PublicRelationshipName == "oneToOnePerson"; + var diffCheck = updatedRelationship.Key.PublicRelationshipName == "oneToOnePerson"; var getAffectedCheck = entities.GetAffected(e => e.OneToOnePerson).Any(); - return (dbCheck && reqCheck && diffcheck && getAffectedCheck); + return (dbCheck && reqCheck && diffCheck && getAffectedCheck); } private bool TodoCheck(IRelationshipsDictionary rh, string checksum) diff --git a/test/UnitTests/ResourceHooks/ResourceHooksTestsSetup.cs b/test/UnitTests/ResourceHooks/ResourceHooksTestsSetup.cs index 35dfe52cde..8fa2473c5b 100644 --- a/test/UnitTests/ResourceHooks/ResourceHooksTestsSetup.cs +++ b/test/UnitTests/ResourceHooks/ResourceHooksTestsSetup.cs @@ -383,8 +383,8 @@ protected List GetIncludedRelationshipsChain(string chain { var parsedChain = new List(); var resourceContext = _resourceGraph.GetResourceContext(); - var splittedPath = chain.Split(QueryConstants.DOT); - foreach (var requestedRelationship in splittedPath) + var splitPath = chain.Split(QueryConstants.DOT); + foreach (var requestedRelationship in splitPath) { var relationship = resourceContext.Relationships.Single(r => r.PublicRelationshipName == requestedRelationship); parsedChain.Add(relationship); diff --git a/test/UnitTests/Serialization/Common/DocumentParserTests.cs b/test/UnitTests/Serialization/Common/DocumentParserTests.cs index aef9e115f5..68a1d6f62f 100644 --- a/test/UnitTests/Serialization/Common/DocumentParserTests.cs +++ b/test/UnitTests/Serialization/Common/DocumentParserTests.cs @@ -22,7 +22,7 @@ public BaseDocumentParserTests() [Fact] public void DeserializeResourceIdentifiers_SingleData_CanDeserialize() { - // arange + // Arrange var content = new Document { Data = new ResourceObject @@ -43,7 +43,7 @@ public void DeserializeResourceIdentifiers_SingleData_CanDeserialize() [Fact] public void DeserializeResourceIdentifiers_EmptySingleData_CanDeserialize() { - // arange + // Arrange var content = new Document { }; var body = JsonConvert.SerializeObject(content); @@ -57,7 +57,7 @@ public void DeserializeResourceIdentifiers_EmptySingleData_CanDeserialize() [Fact] public void DeserializeResourceIdentifiers_ArrayData_CanDeserialize() { - // arange + // Arrange var content = new Document { Data = new List diff --git a/test/UnitTests/Serialization/SerializerTestsSetup.cs b/test/UnitTests/Serialization/SerializerTestsSetup.cs index 133482a5d1..a23fced6c7 100644 --- a/test/UnitTests/Serialization/SerializerTestsSetup.cs +++ b/test/UnitTests/Serialization/SerializerTestsSetup.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using JsonApiDotNetCore.Internal; @@ -18,12 +18,12 @@ namespace UnitTests.Serialization { public class SerializerTestsSetup : SerializationTestsSetupBase { - protected readonly TopLevelLinks _dummyToplevelLinks; + protected readonly TopLevelLinks _dummyTopLevelLinks; protected readonly ResourceLinks _dummyResourceLinks; protected readonly RelationshipLinks _dummyRelationshipLinks; public SerializerTestsSetup() { - _dummyToplevelLinks = new TopLevelLinks + _dummyTopLevelLinks = new TopLevelLinks { Self = "http://www.dummy.com/dummy-self-link", Next = "http://www.dummy.com/dummy-next-link", @@ -144,4 +144,4 @@ public TestDocumentBuilder(IResourceObjectBuilder resourceObjectBuilder, IResour } } } -} \ No newline at end of file +} diff --git a/test/UnitTests/Serialization/Server/IncludedResourceObjectBuilderTests.cs b/test/UnitTests/Serialization/Server/IncludedResourceObjectBuilderTests.cs index f30d40dc5b..f2e5e65929 100644 --- a/test/UnitTests/Serialization/Server/IncludedResourceObjectBuilderTests.cs +++ b/test/UnitTests/Serialization/Server/IncludedResourceObjectBuilderTests.cs @@ -55,7 +55,7 @@ public void BuildIncluded_DeeplyNestedCircularChainOfManyData_BuildsWithoutDupli } [Fact] - public void BuildIncluded_OverlappingDeeplyNestedCirculairChains_CanBuild() + public void BuildIncluded_OverlappingDeeplyNestedCircularChains_CanBuild() { // Arrange var authorChain = GetIncludedRelationshipsChain("author.blogs.reviewer.favoriteFood"); @@ -73,9 +73,9 @@ public void BuildIncluded_OverlappingDeeplyNestedCirculairChains_CanBuild() // Assert Assert.Equal(10, result.Count); - var overlappingBlogResourcObject = result.Single((ro) => ro.Type == "blogs" && ro.Id == sharedBlog.StringId); + var overlappingBlogResourceObject = result.Single((ro) => ro.Type == "blogs" && ro.Id == sharedBlog.StringId); - Assert.Equal(2, overlappingBlogResourcObject.Relationships.Keys.ToList().Count); + Assert.Equal(2, overlappingBlogResourceObject.Relationships.Keys.ToList().Count); var nonOverlappingBlogs = result.Where((ro) => ro.Type == "blogs" && ro.Id != sharedBlog.StringId).ToList(); foreach (var blog in nonOverlappingBlogs) @@ -158,8 +158,8 @@ private List GetIncludedRelationshipsChain(string chain) { var parsedChain = new List(); var resourceContext = _resourceGraph.GetResourceContext
(); - var splittedPath = chain.Split(QueryConstants.DOT); - foreach (var requestedRelationship in splittedPath) + var splitPath = chain.Split(QueryConstants.DOT); + foreach (var requestedRelationship in splitPath) { var relationship = resourceContext.Relationships.Single(r => r.PublicRelationshipName == requestedRelationship); parsedChain.Add(relationship); diff --git a/test/UnitTests/Serialization/Server/ResponseSerializerTests.cs b/test/UnitTests/Serialization/Server/ResponseSerializerTests.cs index 72cf105684..200c8e273f 100644 --- a/test/UnitTests/Serialization/Server/ResponseSerializerTests.cs +++ b/test/UnitTests/Serialization/Server/ResponseSerializerTests.cs @@ -263,7 +263,7 @@ public void SerializeSingle_ResourceWithLinksEnabled_CanSerialize() { // Arrange var entity = new OneToManyPrincipal { Id = 10 }; - var serializer = GetResponseSerializer(topLinks: _dummyToplevelLinks, relationshipLinks: _dummyRelationshipLinks, resourceLinks: _dummyResourceLinks); + var serializer = GetResponseSerializer(topLinks: _dummyTopLevelLinks, relationshipLinks: _dummyRelationshipLinks, resourceLinks: _dummyResourceLinks); // Act string serialized = serializer.SerializeSingle(entity); @@ -336,7 +336,7 @@ public void SerializeSingle_NullWithLinksAndMeta_StillShowsLinksAndMeta() // Arrange var meta = new Dictionary { { "test", "meta" } }; OneToManyPrincipal entity = null; - var serializer = GetResponseSerializer(metaDict: meta, topLinks: _dummyToplevelLinks, relationshipLinks: _dummyRelationshipLinks, resourceLinks: _dummyResourceLinks); + var serializer = GetResponseSerializer(metaDict: meta, topLinks: _dummyTopLevelLinks, relationshipLinks: _dummyRelationshipLinks, resourceLinks: _dummyResourceLinks); // Act string serialized = serializer.SerializeSingle(entity); // Assert