Skip to content

Commit d2ded92

Browse files
authored
Merge pull request #2352 from Lehonti/master
2 parents d13058f + d4d3d13 commit d2ded92

44 files changed

Lines changed: 69 additions & 69 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LiteDB.Shell/Utils/OptionSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace LiteDB.Shell
99
/// </summary>
1010
internal class OptionSet
1111
{
12-
private Dictionary<string, OptionsParam> _options = new Dictionary<string, OptionsParam>(StringComparer.OrdinalIgnoreCase);
12+
private readonly Dictionary<string, OptionsParam> _options = new Dictionary<string, OptionsParam>(StringComparer.OrdinalIgnoreCase);
1313

1414
/// <summary>
1515
/// Register all extra non parameter (without -- or /)

LiteDB.Stress/Test/InsertField.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public enum InsertFieldType { Name, Int, Guid, Bool, Now, Binary, Date, Json }
1010

1111
public class InsertField
1212
{
13-
private Random _rnd = new Random();
13+
private readonly Random _rnd = new Random();
1414

1515
#region Names
1616

17-
private static string[] _firstNames = new string[]
17+
private static readonly string[] _firstNames = new string[]
1818
{
1919
"Blaze", "Zenia", "Malik", "Palmer", "Valentine", "Quinn", "Preston", "John", "Ferdinand", "Cassidy", "Kai", "Alma", "Cullen",
2020
"Colorado", "Sean", "Kadeem", "Faith", "Dexter", "Olympia", "Alden", "Gloria", "Dahlia", "Melissa", "Fiona", "Oliver", "Daryl",
@@ -95,7 +95,7 @@ public class InsertField
9595
"Perry", "Jason", "Levi", "Deacon", "Reese", "Arsenio", "Molly", "Cade", "Mufutau", "Cole", "Tamara", "Ann"
9696
};
9797

98-
private static string[] _lastNames = new string[]
98+
private static readonly string[] _lastNames = new string[]
9999
{
100100
"Hakeem", "Jena", "Donna", "Cameron", "Ramona", "Guy", "Frances", "Price", "Sydnee", "Miriam", "Quinlan", "Margaret", "Mikayla", "Chester",
101101
"Dean", "Priscilla", "Astra", "Debra", "Kasimir", "Kane", "Amelia", "Phoebe", "Justina", "Brady", "Sybil", "Zeus", "Amethyst", "Dante",

LiteDB.Stress/Test/InsertTaskItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace LiteDB.Stress
88
{
99
public class InsertTaskItem : ITestItem
1010
{
11-
private Random _rnd = new Random();
11+
private readonly Random _rnd = new Random();
1212

1313
private ILiteCollection<BsonDocument> _collection;
1414

LiteDB.Tests/Database/IndexSortAndFilter_Tests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public class Item
1818

1919
#endregion
2020

21-
private ILiteCollection<Item> _collection;
22-
private TempFile _tempFile;
23-
private ILiteDatabase _database;
21+
private readonly ILiteCollection<Item> _collection;
22+
private readonly TempFile _tempFile;
23+
private readonly ILiteDatabase _database;
2424

2525
public IndexSortAndFilterTest()
2626
{

LiteDB.Tests/Database/Storage_Tests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ namespace LiteDB.Tests.Database
99
{
1010
public class Storage_Tests
1111
{
12-
private Random _rnd = new Random();
13-
private byte[] _smallFile;
14-
private byte[] _bigFile;
15-
private string _smallHash;
16-
private string _bigHash;
12+
private readonly Random _rnd = new Random();
13+
private readonly byte[] _smallFile;
14+
private readonly byte[] _bigFile;
15+
private readonly string _smallHash;
16+
private readonly string _bigHash;
1717

1818
public Storage_Tests()
1919
{

LiteDB.Tests/Engine/Collation_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void Collaction_New_Database()
135135
}
136136
}
137137

138-
private string[] data = new string[]
138+
private readonly string[] data = new string[]
139139
{
140140
"r6pfkr.4keQyr", "r6pfjI.31qrGW", "r6pfjy.1ryYCW", "r6pfjs.1iCqiD", "r6pfjm.2xXoUr", "r6pfj9.sYaWO", "r6pfgj.1aguPU", "r6pfgd.kKEyS",
141141
"r6pfg7.1PD90r", "r6pffZ.1JrB8C", "r6pffU.4Exn9y", "r6pffN.atYDW", "r6pfc1.4cqgs6", "r6pfbF.1YAU7Y", "r6pfbx.463ddU", "r6pfbr.3HzECI",

LiteDB.Tests/Internals/Sort_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace LiteDB.Internals
1010
{
1111
public class Sort_Tests
1212
{
13-
private IStreamFactory _factory = new StreamFactory(new MemoryStream(), null);
13+
private readonly IStreamFactory _factory = new StreamFactory(new MemoryStream(), null);
1414

1515
[Fact]
1616
public void Sort_String_Asc()

LiteDB.Tests/Issues/Issue2112_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace LiteDB.Tests.Issues
77
{
88
public class Issue2112_Tests
99
{
10-
private BsonMapper _mapper = new BsonMapper();
10+
private readonly BsonMapper _mapper = new BsonMapper();
1111

1212
[Fact]
1313
public void Serialize_covariant_collection_has_type()

LiteDB.Tests/Mapper/CustomMappingCtor_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public ClassByte(byte myByte)
7474
}
7575
}
7676

77-
private BsonMapper _mapper = new BsonMapper();
77+
private readonly BsonMapper _mapper = new BsonMapper();
7878

7979
[Fact]
8080
public void Custom_Ctor()

LiteDB.Tests/Mapper/Dictionary_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Dict
1414
public IDictionary<DateTime, string> DateDict { get; set; } = new Dictionary<DateTime, string>();
1515
}
1616

17-
private BsonMapper _mapper = new BsonMapper();
17+
private readonly BsonMapper _mapper = new BsonMapper();
1818

1919
[Fact]
2020
public void Dictionary_Map()

0 commit comments

Comments
 (0)