diff --git a/Dapper.Tests.Contrib/TestSuite.cs b/Dapper.Tests.Contrib/TestSuite.cs index 83b15a2eb4698574a5c1bb6c5db81edfd4415973..7274da21bca994a8fdf849aeb11fa46f2e1c368d 100644 --- a/Dapper.Tests.Contrib/TestSuite.cs +++ b/Dapper.Tests.Contrib/TestSuite.cs @@ -469,7 +469,7 @@ public void InsertWithCustomTableNameMapper() var name = type.Name + "s"; if (type.IsInterface() && name.StartsWith("I")) - name = name.Substring(1); + return name.Substring(1); return name; } }; diff --git a/Dapper.Tests.Performance/Massive/Massive.cs b/Dapper.Tests.Performance/Massive/Massive.cs index 6502b519e6680ef119b0c14bcb52c9b50076f36f..a443911eac92b894321967ef1fd23ba969d569da 100644 --- a/Dapper.Tests.Performance/Massive/Massive.cs +++ b/Dapper.Tests.Performance/Massive/Massive.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Text; +#pragma warning disable RCS1141 // Add parameter to documentation comment. namespace Massive { public static class ObjectExtensions @@ -115,7 +116,9 @@ public class DynamicModel { private readonly DbProviderFactory _factory; #pragma warning disable 0649 +#pragma warning disable RCS1169 // Mark field as read-only. private string _connectionString; +#pragma warning restore RCS1169 // Mark field as read-only. #pragma warning restore 0649 public DynamicModel(string connectionStringName = "", string tableName = "", string primaryKeyField = "") @@ -450,4 +453,5 @@ public virtual dynamic Single(object key, string columns = "*") } } } +#pragma warning restore RCS1141 // Add parameter to documentation comment. #endif \ No newline at end of file diff --git a/Dapper.Tests.Performance/PerformanceTests.cs b/Dapper.Tests.Performance/PerformanceTests.cs index 56e64d2792bb1e9be505f4b1671bc5d60d82d4b7..27acaff69d827b498511322e3b8cb3c44cc5217f 100644 --- a/Dapper.Tests.Performance/PerformanceTests.cs +++ b/Dapper.Tests.Performance/PerformanceTests.cs @@ -51,7 +51,7 @@ public void Add(Action iteration, string name) Add(new Test(iteration, name)); } - public void AddAsync(Func iterationAsync, string name) + public void AsyncAdd(Func iterationAsync, string name) { Add(new Test(iterationAsync, name)); } @@ -230,7 +230,7 @@ public async Task RunAsync(int iterations) Try(() => { var query = new Belgrade.SqlClient.SqlDb.QueryMapper(ConnectionString); - tests.AddAsync(id => query.ExecuteReader("SELECT TOP 1 * FROM Posts WHERE Id = " + id, + tests.AsyncAdd(id => query.ExecuteReader("SELECT TOP 1 * FROM Posts WHERE Id = " + id, reader => { var post = new Post(); diff --git a/Dapper.Tests.Performance/PetaPoco/PetaPoco.cs b/Dapper.Tests.Performance/PetaPoco/PetaPoco.cs index d3835f49aac1aa1d85939869134b7db92258a2f9..df9575a236ad23f7de79e4ab5f0c7836d97d9f63 100644 --- a/Dapper.Tests.Performance/PetaPoco/PetaPoco.cs +++ b/Dapper.Tests.Performance/PetaPoco/PetaPoco.cs @@ -10,6 +10,7 @@ using System.Reflection; using System.Reflection.Emit; +#pragma warning disable RCS1023 // Format empty block. namespace PetaPoco { // Poco's marked [Explicit] require all column properties to be marked @@ -37,8 +38,8 @@ public class Column : Attribute public class ResultColumn : Column { public ResultColumn() { } - public ResultColumn(string name) : base(name) { } - } + public ResultColumn(string name) : base(name) { } + } // Specify the table name of a poco [AttributeUsage(AttributeTargets.Class)] @@ -1287,7 +1288,7 @@ public void Dispose() _db.CloseSharedConnection(); } } - + // Member variables private readonly string _connectionString; private readonly string _providerName; @@ -1441,4 +1442,5 @@ public void Build(StringBuilder sb, List args, Sql lhs) } } } +#pragma warning restore RCS1023 // Format empty block. #endif \ No newline at end of file diff --git a/Dapper.Tests.Performance/Soma/SomaConfig.cs b/Dapper.Tests.Performance/Soma/SomaConfig.cs index 0716e98d1e78c445fa6b9a5055aaeeee01bdb45f..4eede2ae8314e47697eff9c3ed72f6bb4656fb2c 100644 --- a/Dapper.Tests.Performance/Soma/SomaConfig.cs +++ b/Dapper.Tests.Performance/Soma/SomaConfig.cs @@ -9,6 +9,6 @@ internal class SomaConfig : MsSqlConfig public override Action Logger => noOp; - private static readonly Action noOp = x => { }; + private static readonly Action noOp = x => { /* nope */ }; } } diff --git a/Dapper.Tests/AsyncTests.cs b/Dapper.Tests/AsyncTests.cs index 229d5f1061b488331206a0e427c0fe10bf039f4e..dd49110467731b115bae1c237c02897b3bc98e01 100644 --- a/Dapper.Tests/AsyncTests.cs +++ b/Dapper.Tests/AsyncTests.cs @@ -791,7 +791,7 @@ public async Task Issue563_QueryAsyncShouldThrowException() var data = (await connection.QueryAsync("select 1 union all select 2; RAISERROR('after select', 16, 1);").ConfigureAwait(false)).ToList(); Assert.Fail(); } - catch (SqlException ex) when (ex.Message == "after select") { } + catch (SqlException ex) when (ex.Message == "after select") { /* swallow only this */ } } } } \ No newline at end of file diff --git a/Dapper.Tests/ConstructorTests.cs b/Dapper.Tests/ConstructorTests.cs index b2a567079f606467f1509097cc1375194fd56c71..ea61a1fac90c9a482a49648dfd7480daf0320c53 100644 --- a/Dapper.Tests/ConstructorTests.cs +++ b/Dapper.Tests/ConstructorTests.cs @@ -90,7 +90,7 @@ private class _ExplicitConstructors private readonly bool WentThroughProperConstructor; - public _ExplicitConstructors() { } + public _ExplicitConstructors() { /* yep */ } [ExplicitConstructor] public _ExplicitConstructors(string foo, int bar) diff --git a/Dapper.Tests/MiscTests.cs b/Dapper.Tests/MiscTests.cs index 8465e44744bea370d016dd2e9a8c6f767ee4c7d8..6dd83b5acbb84aefde06fc4fad91e7332f596500 100644 --- a/Dapper.Tests/MiscTests.cs +++ b/Dapper.Tests/MiscTests.cs @@ -471,7 +471,9 @@ private class TestFieldCaseAndPrivatesEntity private int b { get; set; } public int GetB() { return b; } public int c = 0; +#pragma warning disable RCS1169 // Mark field as read-only. private int d = 0; +#pragma warning restore RCS1169 // Mark field as read-only. public int GetD() { return d; } public int e { get; set; } private string f diff --git a/Dapper.Tests/Providers/MySQLTests.cs b/Dapper.Tests/Providers/MySQLTests.cs index dee348fcb8d896856ffd47ced3487ac3be3f551c..3063368874c8bf7f7fb448deb3f598b0f5948bdc 100644 --- a/Dapper.Tests/Providers/MySQLTests.cs +++ b/Dapper.Tests/Providers/MySQLTests.cs @@ -176,7 +176,7 @@ static FactMySqlAttribute() { try { - using (GetMySqlConnection(true)) { } + using (GetMySqlConnection(true)) { /* just trying to see if it works */ } } catch (Exception ex) { diff --git a/Dapper.Tests/Providers/PostgresqlTests.cs b/Dapper.Tests/Providers/PostgresqlTests.cs index 57aaab3de7b48e9a39c385b85ee78661d5536085..acb9338e678f5343a765552ab17fb5243558cfd1 100644 --- a/Dapper.Tests/Providers/PostgresqlTests.cs +++ b/Dapper.Tests/Providers/PostgresqlTests.cs @@ -71,7 +71,7 @@ static FactPostgresqlAttribute() { try { - using (GetOpenNpgsqlConnection()) { } + using (GetOpenNpgsqlConnection()) { /* just trying to see if it works */ } } catch (Exception ex) { diff --git a/Dapper.Tests/TypeHandlerTests.cs b/Dapper.Tests/TypeHandlerTests.cs index 75dbd6e2205dfd8f1a093afef025df1469826fc6..65f7c00fbc603c2c22866d1c5f5408e7c0b74fb6 100644 --- a/Dapper.Tests/TypeHandlerTests.cs +++ b/Dapper.Tests/TypeHandlerTests.cs @@ -69,7 +69,7 @@ public void Issue136_ValueTypeHandlers() public class LocalDateHandler : SqlMapper.TypeHandler { - private LocalDateHandler() { } + private LocalDateHandler() { /* private constructor */ } // Make the field type ITypeHandler to ensure it cannot be used with SqlMapper.AddTypeHandler(TypeHandler) // by mistake.