Skip to content

Commit

Permalink
Remove unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
jordimontana82 committed Oct 13, 2023
1 parent b19802a commit 8fe8bb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/FakeXrmEasy.Core/XrmFakedContext.Queries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ private static Type FindReflectedType(string logicalName,
{
try
{
if (assembly == null)
{
throw new ArgumentNullException(nameof(assembly));
}

var subClassType = assembly.GetTypes()
.Where(t => typeof(Entity).IsAssignableFrom(t))
.Where(t => t.GetCustomAttributes(typeof(EntityLogicalNameAttribute), true).Length > 0)
Expand Down Expand Up @@ -142,11 +137,6 @@ private static Type FindReflectedType(int entityTypeCode,
{
try
{
if (assembly == null)
{
throw new ArgumentNullException(nameof(assembly));
}

var subClassType = assembly.GetTypes()
.Where(t => typeof(Entity).IsAssignableFrom(t))
.Where(t => t.GetCustomAttributes(typeof(EntityLogicalNameAttribute), true).Length > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,15 @@ public void Should_throw_exception_when_finding_reflected_type_by_entity_logical
Assert.Throws<InvalidOperationException>(() => _context.FindReflectedType(Account.EntityLogicalName));
}

[Fact]
public void Should_throw_argument_exception_when_finding_reflected_type_by_entity_logical_for_a_null_assembly()
{
var assembly = typeof(Crm.Account).Assembly;
_context.EnableProxyTypes(assembly);

Assert.Throws<InvalidOperationException>(() => _context.FindReflectedType(Account.EntityLogicalName));
}

[Fact]
public void Should_throw_exception_when_finding_reflected_type_by_entity_type_code_if_exists_in_more_than_one_assembly()
{
Expand Down

0 comments on commit 8fe8bb4

Please sign in to comment.