Skip to content

Commit f7f3b7f

Browse files
committed
implemented changes suggested in code review
1 parent ae002bd commit f7f3b7f

8 files changed

Lines changed: 11 additions & 9 deletions

File tree

NTestDataBuilder.Tests/DataSources/Dictionaries/FileDictionarySourceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void WhenInitializingList_ThenPassClassNameToRepositoryAsDictionaryName()
2121

2222
public class DummySource : FileDictionarySource
2323
{
24-
public DummySource(IDictionaryRepository repository)
24+
internal DummySource(IDictionaryRepository repository)
2525
: base(Substitute.For<IGenerator>(), repository) { }
2626
}
2727
}

NTestDataBuilder.Tests/EquivalenceClasses/DictionaryEquivalenceClassesTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
namespace NTestDataBuilder.Tests.EquivalenceClasses
1212
{
13-
public class PersonEquivalenceClassesTests
13+
public class DictionaryEquivalenceClassesTests
1414
{
1515
public static AnonymousValueFixture Any { get; private set; }
1616

17-
public PersonEquivalenceClassesTests()
17+
public DictionaryEquivalenceClassesTests()
1818
{
1919
Any = new AnonymousValueFixture();
2020
}

NTestDataBuilder/DataSources/Dictionaries/Cache.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Concurrent;
2+
using System.Collections.Generic;
23

34
namespace NTestDataBuilder.DataSources.Dictionaries
45
{
56
internal static class Cache
67
{
7-
private static IDictionary<string, IList<string>> _cache = new Dictionary<string, IList<string>>();
8+
private static ConcurrentDictionary<string, IList<string>> _cache = new ConcurrentDictionary<string, IList<string>>();
89

910
internal static IList<string> Get(string dictionary)
1011
{
@@ -23,7 +24,7 @@ public static bool Contains(string key)
2324

2425
public static void Clear()
2526
{
26-
_cache = new Dictionary<string, IList<string>>();
27+
_cache = new ConcurrentDictionary<string, IList<string>>();
2728
}
2829
}
2930
}

NTestDataBuilder/DataSources/Dictionaries/CachedFileDictionaryRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace NTestDataBuilder.DataSources.Dictionaries
88
/// <summary>
99
/// Retrieves words from dictionaries stored in files. First looks for external file that user might have created. If this does not exist then data is retrieved from embedded resource files.
1010
/// </summary>
11-
public class CachedFileDictionaryRepository : IDictionaryRepository
11+
internal class CachedFileDictionaryRepository : IDictionaryRepository
1212
{
1313
public IList<string> GetWordsFrom(string dictionary)
1414
{

NTestDataBuilder/DataSources/Dictionaries/FileDictionarySource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protected FileDictionarySource()
1515
: this(new RandomGenerator(), new CachedFileDictionaryRepository()) { }
1616

1717
/// <inheritdoc />
18-
public FileDictionarySource(IGenerator generator, IDictionaryRepository repository)
18+
internal FileDictionarySource(IGenerator generator, IDictionaryRepository repository)
1919
: base(generator)
2020
{
2121
_repository = repository;

NTestDataBuilder/DataSources/Dictionaries/IDictionaryRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace NTestDataBuilder.DataSources.Dictionaries
55
/// <summary>
66
/// Retrieves words from specified dictionaries
77
/// </summary>
8-
public interface IDictionaryRepository
8+
internal interface IDictionaryRepository
99
{
1010
/// <summary>
1111
/// Retrieves words from specified dictionary

NTestDataBuilder/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
[assembly: AssemblyCulture("")]
1616

1717
[assembly: InternalsVisibleTo("NTestDataBuilder.Tests")]
18+
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
1819

1920
// Setting ComVisible to false makes the types in this assembly not visible
2021
// to COM components. If you need to access a type in this assembly from
Binary file not shown.

0 commit comments

Comments
 (0)