aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Timeline.Tests/Helpers/TestClock.cs2
-rw-r--r--Timeline.Tests/IntegratedTests/TimelineTest.cs8
-rw-r--r--Timeline/Models/Validation/Validator.cs4
-rw-r--r--Timeline/Services/ETagGenerator.cs2
-rw-r--r--Timeline/Services/TimelineService.cs2
-rw-r--r--Timeline/Services/UserService.cs5
-rw-r--r--Timeline/Services/UserTokenException.cs4
-rw-r--r--Timeline/Timeline.csproj2
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
/// </summary>
/// <typeparam name="T">The type of accepted value.</typeparam>
/// <remarks>
- /// Subclass should override <see cref="DoValidate(T, out string)"/> to do the real validation.
+ /// Subclass should override <see cref="DoValidate(T)"/> 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 <see cref="PermitNull"/>.
/// If value is not null and not of type <typeparamref name="T"/>
- /// it will fail and not call <see cref="DoValidate(T, out string)"/>.
+ /// it will fail and not call <see cref="DoValidate(T)"/>.
///
/// <see cref="PermitNull"/> 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 <paramref name="timelineName"/> does not exist.
/// If it is a personal timeline, then inner exception is <see cref="UserNotExistException"/>.
/// </exception>
+ /// <remarks>
/// This method does not check whether visitor is administrator.
/// Return false if user with user id does not exist.
/// </remarks>
@@ -277,6 +278,7 @@ namespace Timeline.Services
/// Thrown when timeline with name <paramref name="timelineName"/> does not exist.
/// If it is a personal timeline, then inner exception is <see cref="UserNotExistException"/>.
/// </exception>
+ /// <remarks>
/// This method does not check whether visitor is administrator.
/// Return false if user with visitor id does not exist.
/// </remarks>
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.
/// </summary>
/// <param name="info">The info of new user.</param>
- /// <param name="password">The password, can't be null or empty.</param>
/// <returns>The the new user.</returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="info"/>is null.</exception>
/// <exception cref="ArgumentException">Thrown when some fields in <paramref name="info"/> is bad.</exception>
- /// <exception cref="ConflictException">Thrown when a user with given username already exists.</exception>
+ /// <exception cref="EntityAlreadyExistException">Thrown when a user with given username already exists.</exception>
/// <remarks>
/// <see cref="User.Username"/> must not be null and must be a valid username.
/// <see cref="User.Password"/> must not be null or empty.
@@ -110,7 +109,7 @@ namespace Timeline.Services
/// <exception cref="ArgumentNullException">Thrown when <paramref name="username"/> is null.</exception>
/// <exception cref="ArgumentException">Thrown when <paramref name="username"/> is of bad format or some fields in <paramref name="info"/> is bad.</exception>
/// <exception cref="UserNotExistException">Thrown when user with given id does not exist.</exception>
- /// <exception cref="ConflictException">Thrown when user with the newusername already exist.</exception>
+ /// <exception cref="EntityAlreadyExistException">Thrown when user with the newusername already exist.</exception>
/// <remarks>
/// Only <see cref="User.Administrator"/>, <see cref="User.Password"/> and <see cref="User.Nickname"/> 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 @@
<Version>0.3.0</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
+
+ <NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<ItemGroup>