Skip to content

Commit

Permalink
rename attr
Browse files Browse the repository at this point in the history
  • Loading branch information
Rast1234 committed Jun 29, 2020
1 parent 20fb709 commit 9872571
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace Tochka.JsonRpc.Server.Attributes
/// </summary>
[ExcludeFromCodeCoverage]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class RpcSerializerAttribute : Attribute
public class JsonRpcSerializerAttribute : Attribute
{
public Type SerializerType { get; }

public RpcSerializerAttribute(Type serializerType)
public JsonRpcSerializerAttribute(Type serializerType)
{
if (!typeof(IRpcSerializer).IsAssignableFrom(serializerType))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tochka.JsonRpc.Server/Conventions/ActionConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ internal void SetAttributes(ActionModel actionModel, JsonRpcMethodOptions method
/// <returns></returns>
internal JsonRpcMethodOptions MakeOptions(ActionModel actionModel)
{
var serializerType = Utils.GetAttributeTransitive<RpcSerializerAttribute>(actionModel)?.SerializerType ?? defaultMethodOptions.RequestSerializer;
var serializerType = Utils.GetAttributeTransitive<JsonRpcSerializerAttribute>(actionModel)?.SerializerType ?? defaultMethodOptions.RequestSerializer;
var route = Utils.GetAttributeTransitive<RouteAttribute>(actionModel)?.Template ?? defaultMethodOptions.Route;
var method = Utils.GetAttributeTransitive<RpcMethodStyleAttribute>(actionModel)?.MethodStyle ?? defaultMethodOptions.MethodStyle;
log.LogTrace($"{actionModel.DisplayName}: options are [{serializerType.FullName}], [{route}], [{method}]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void Test_MakeOptions_UsesActionAttributes()
var methodStyle = MethodStyle.ActionOnly;
var attributes = new List<object>
{
new Mock<RpcSerializerAttribute>(serializerType).Object,
new Mock<JsonRpcSerializerAttribute>(serializerType).Object,
new Mock<RouteAttribute>(route.Value).Object,
new Mock<RpcMethodStyleAttribute>(methodStyle).Object,
};
Expand All @@ -139,7 +139,7 @@ public void Test_MakeOptions_UsesControllerAttributes()
var methodStyle = MethodStyle.ActionOnly;
var attributes = new List<object>
{
new Mock<RpcSerializerAttribute>(serializerType).Object,
new Mock<JsonRpcSerializerAttribute>(serializerType).Object,
new Mock<RouteAttribute>(route.Value).Object,
new Mock<RpcMethodStyleAttribute>(methodStyle).Object,
};
Expand Down

0 comments on commit 9872571

Please sign in to comment.