Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DynamicNotifyPropertyChanged/TypeCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class TypeCache
internal static bool TryGetObjectGetterSetter(Type type, string propertyName, out DynamicObjectGetterSetter? getterSetter)
{
getterSetter = Cache
.GetOrAdd(type, _ => new(() => new()))
.GetOrAdd(type, _ => new(() => new ConcurrentDictionary<string, Lazy<DynamicObjectGetterSetter?>>(StringComparer.OrdinalIgnoreCase)))
.Value
#if NETSTANDARD2_1
.GetOrAdd(propertyName, static (x, t) => CreateLazyGetterSetter(t, x), type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ public void ReturnCachedGetter()
.Should()
.Be(factory2);
}

[Fact]
public void BeCaseInsensitive()
{
var type = typeof(TestClass);

var factory1 = type.GetPropertyGetter(nameof(TestClass.Value));
var factory2 = type.GetPropertyGetter(nameof(TestClass.Value).ToLower());

factory1
.Should()
.Be(factory2);
}

[Fact]
public void ThrowExceptionIfPropertyNotFound()
Expand Down