From c79352d27df2506d2ab214f61d60e503a1d7675a Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 21 Aug 2020 23:32:53 +0800 Subject: ... --- Timeline.Tests/Helpers/TestClock.cs | 2 +- Timeline.Tests/IntegratedTests/TimelineTest.cs | 8 ++++---- Timeline/Models/Validation/Validator.cs | 4 ++-- Timeline/Services/ETagGenerator.cs | 2 +- Timeline/Services/TimelineService.cs | 2 ++ Timeline/Services/UserService.cs | 5 ++--- Timeline/Services/UserTokenException.cs | 4 ++-- Timeline/Timeline.csproj | 2 ++ 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Timeline.Tests/Helpers/TestClock.cs b/Timeline.Tests/Helpers/TestClock.cs index ed2d65a6..34adb245 100644 --- a/Timeline.Tests/Helpers/TestClock.cs +++ b/Timeline.Tests/Helpers/TestClock.cs @@ -8,7 +8,7 @@ namespace Timeline.Tests.Helpers { public class TestClock : IClock { - private DateTime? _currentTime = null; + private DateTime? _currentTime; public DateTime GetCurrentTime() { diff --git a/Timeline.Tests/IntegratedTests/TimelineTest.cs b/Timeline.Tests/IntegratedTests/TimelineTest.cs index 16b3c7e4..3b4b1754 100644 --- a/Timeline.Tests/IntegratedTests/TimelineTest.cs +++ b/Timeline.Tests/IntegratedTests/TimelineTest.cs @@ -76,20 +76,20 @@ namespace Timeline.Tests.IntegratedTests if (subpath != null) { if (!subpath.StartsWith("/", StringComparison.OrdinalIgnoreCase)) - result.Append("/"); + result.Append('/'); result.Append(subpath); } if (query != null && query.Count != 0) { - result.Append("?"); + result.Append('?'); foreach (var (key, value, index) in query.Select((pair, index) => (pair.Key, pair.Value, index))) { result.Append(WebUtility.UrlEncode(key)); - result.Append("="); + result.Append('='); result.Append(WebUtility.UrlEncode(value)); if (index != query.Count - 1) - result.Append("&"); + result.Append('&'); } } diff --git a/Timeline/Models/Validation/Validator.cs b/Timeline/Models/Validation/Validator.cs index db139448..aef7891c 100644 --- a/Timeline/Models/Validation/Validator.cs +++ b/Timeline/Models/Validation/Validator.cs @@ -35,11 +35,11 @@ namespace Timeline.Models.Validation /// /// The type of accepted value. /// - /// Subclass should override to do the real validation. + /// Subclass should override to do the real validation. /// This class will check the nullity and type of value. /// If value is null, it will pass or fail depending on . /// If value is not null and not of type - /// it will fail and not call . + /// it will fail and not call . /// /// is true by default. /// diff --git a/Timeline/Services/ETagGenerator.cs b/Timeline/Services/ETagGenerator.cs index d328ea20..4493e903 100644 --- a/Timeline/Services/ETagGenerator.cs +++ b/Timeline/Services/ETagGenerator.cs @@ -33,7 +33,7 @@ namespace Timeline.Services return Task.Run(() => Convert.ToBase64String(_sha1.ComputeHash(source))); } - private bool _disposed = false; // To detect redundant calls + private bool _disposed; // To detect redundant calls public void Dispose() { diff --git a/Timeline/Services/TimelineService.cs b/Timeline/Services/TimelineService.cs index 0070fe3e..01f7f5fd 100644 --- a/Timeline/Services/TimelineService.cs +++ b/Timeline/Services/TimelineService.cs @@ -260,6 +260,7 @@ namespace Timeline.Services /// Thrown when timeline with name does not exist. /// If it is a personal timeline, then inner exception is . /// + /// /// This method does not check whether visitor is administrator. /// Return false if user with user id does not exist. /// @@ -277,6 +278,7 @@ namespace Timeline.Services /// Thrown when timeline with name does not exist. /// If it is a personal timeline, then inner exception is . /// + /// /// This method does not check whether visitor is administrator. /// Return false if user with visitor id does not exist. /// diff --git a/Timeline/Services/UserService.cs b/Timeline/Services/UserService.cs index d9b3da26..821bc33d 100644 --- a/Timeline/Services/UserService.cs +++ b/Timeline/Services/UserService.cs @@ -65,11 +65,10 @@ namespace Timeline.Services /// Create a user with given info. /// /// The info of new user. - /// The password, can't be null or empty. /// The the new user. /// Thrown when is null. /// Thrown when some fields in is bad. - /// Thrown when a user with given username already exists. + /// Thrown when a user with given username already exists. /// /// must not be null and must be a valid username. /// must not be null or empty. @@ -110,7 +109,7 @@ namespace Timeline.Services /// Thrown when is null. /// Thrown when is of bad format or some fields in is bad. /// Thrown when user with given id does not exist. - /// Thrown when user with the newusername already exist. + /// Thrown when user with the newusername already exist. /// /// Only , and will be used. /// If null, then not change. diff --git a/Timeline/Services/UserTokenException.cs b/Timeline/Services/UserTokenException.cs index ed0bae1a..d25fabb3 100644 --- a/Timeline/Services/UserTokenException.cs +++ b/Timeline/Services/UserTokenException.cs @@ -31,9 +31,9 @@ namespace Timeline.Services System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public DateTime ExpireTime { get; private set; } = default; + public DateTime ExpireTime { get; private set; } - public DateTime VerifyTime { get; private set; } = default; + public DateTime VerifyTime { get; private set; } } [Serializable] diff --git a/Timeline/Timeline.csproj b/Timeline/Timeline.csproj index 5fc69fc8..5ceb97e6 100644 --- a/Timeline/Timeline.csproj +++ b/Timeline/Timeline.csproj @@ -18,6 +18,8 @@ 0.3.0 true true + + 1701;1702;1591 -- cgit v1.2.3