aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-24 20:12:42 +0800
committer杨宇千 <crupest@outlook.com>2019-10-24 20:12:42 +0800
commit2bc4c701f9cdff1fdd11a5736c33a5818fbae3e9 (patch)
tree7ca5010a06829cc5fadea1ea17ae72d082fc344c
parent912455ac19161533205c2fe56b91ff4595ea4fdb (diff)
downloadtimeline-2bc4c701f9cdff1fdd11a5736c33a5818fbae3e9.tar.gz
timeline-2bc4c701f9cdff1fdd11a5736c33a5818fbae3e9.tar.bz2
timeline-2bc4c701f9cdff1fdd11a5736c33a5818fbae3e9.zip
...
-rw-r--r--Timeline.Tests/UserAvatarServiceTest.cs12
-rw-r--r--Timeline/GlobalSuppressions.cs2
-rw-r--r--Timeline/Services/UserService.cs2
-rw-r--r--Timeline/Startup.cs2
4 files changed, 5 insertions, 13 deletions
diff --git a/Timeline.Tests/UserAvatarServiceTest.cs b/Timeline.Tests/UserAvatarServiceTest.cs
index 79fa6f5c..1f71f6f6 100644
--- a/Timeline.Tests/UserAvatarServiceTest.cs
+++ b/Timeline.Tests/UserAvatarServiceTest.cs
@@ -106,7 +106,7 @@ namespace Timeline.Tests
Data = Encoding.ASCII.GetBytes($"mock{key}")
};
- private Avatar ToAvatar(UserAvatar entity)
+ private static Avatar ToAvatar(UserAvatar entity)
{
return new Avatar
{
@@ -115,7 +115,7 @@ namespace Timeline.Tests
};
}
- private AvatarInfo ToAvatarInfo(UserAvatar entity)
+ private static AvatarInfo ToAvatarInfo(UserAvatar entity)
{
return new AvatarInfo
{
@@ -124,14 +124,6 @@ namespace Timeline.Tests
};
}
- private void Set(UserAvatar to, UserAvatar from)
- {
- to.Type = from.Type;
- to.Data = from.Data;
- to.ETag = from.ETag;
- to.LastModified = from.LastModified;
- }
-
private readonly Mock<IDefaultUserAvatarProvider> _mockDefaultAvatarProvider;
private readonly Mock<IUserAvatarValidator> _mockValidator;
private readonly Mock<IETagGenerator> _mockETagGenerator;
diff --git a/Timeline/GlobalSuppressions.cs b/Timeline/GlobalSuppressions.cs
index 44ad3af5..e720e5b7 100644
--- a/Timeline/GlobalSuppressions.cs
+++ b/Timeline/GlobalSuppressions.cs
@@ -9,3 +9,5 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Migrations code are auto generated.", Scope = "namespaceanddescendants", Target = "Timeline.Migrations")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Error code constant identifiers.", Scope = "type", Target = "Timeline.ErrorCodes")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "Error code constant identifiers.", Scope = "type", Target = "Timeline.ErrorCodes")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1724:Type names should not match namespaces", Justification = "Error code constant identifiers.", Scope = "type", Target = "Timeline.ErrorCodes")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1824:Mark assemblies with NeutralResourcesLanguageAttribute", Justification = "Applying this breaks the function of resources in my app.")]
diff --git a/Timeline/Services/UserService.cs b/Timeline/Services/UserService.cs
index f1317856..8f354fc7 100644
--- a/Timeline/Services/UserService.cs
+++ b/Timeline/Services/UserService.cs
@@ -155,7 +155,7 @@ namespace Timeline.Services
_usernameValidator = new UsernameValidator();
}
- private string GenerateCacheKeyByUserId(long id) => $"user:{id}";
+ private static string GenerateCacheKeyByUserId(long id) => $"user:{id}";
private void RemoveCache(long id)
{
diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs
index d54ea6ca..b44add6f 100644
--- a/Timeline/Startup.cs
+++ b/Timeline/Startup.cs
@@ -72,8 +72,6 @@ namespace Timeline
options.UseMySql(databaseConfig.ConnectionString);
});
- services.AddHttpClient();
-
services.AddMemoryCache();
}