Browse Source

Tests fixed

pull/141/head
Sebastian Stehle 8 years ago
parent
commit
dc6e7e504a
  1. 5
      src/Squidex.Infrastructure/TypeNameRegistry.cs
  2. 4
      tests/Squidex.Infrastructure.Tests/TypeNameRegistryTests.cs

5
src/Squidex.Infrastructure/TypeNameRegistry.cs

@ -115,6 +115,11 @@ namespace Squidex.Infrastructure
return GetName(typeof(T));
}
public string GetNameOrNull<T>()
{
return GetNameOrNull(typeof(T));
}
public string GetNameOrNull(Type type)
{
var result = namesByType.GetOrDefault(type);

4
tests/Squidex.Infrastructure.Tests/TypeNameRegistryTests.cs

@ -125,7 +125,7 @@ namespace Squidex.Infrastructure
[Fact]
public void Should_return_null_if_name_is_not_supported()
{
Assert.Null(sut.GetType("unsupported"));
Assert.Null(sut.GetTypeOrNull("unsupported"));
}
[Fact]
@ -137,7 +137,7 @@ namespace Squidex.Infrastructure
[Fact]
public void Should_return_null_if_type_is_not_supported()
{
Assert.Null(sut.GetName<Guid>());
Assert.Null(sut.GetNameOrNull<Guid>());
}
}
}

Loading…
Cancel
Save