Skip to content

Commit

Permalink
Add some tests for AssemblyHelper (#3911)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink authored Jul 29, 2022
1 parent 18aeea4 commit e63ba03
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#if NETFRAMEWORK

using System;
using System.Reflection;

using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities;
Expand Down Expand Up @@ -74,5 +75,19 @@ public void SetNetFrameworkCompatiblityModeShouldNotSetAppDomainTargetFrameWorkW

Assert.IsNull(appDomainSetup.TargetFrameworkName);
}

[TestMethod]
[DataRow(null)]
[DataRow("")]
public void DoesReferencesAssemblyWhenSourceIsNullOrEmptyReturnsNull(string source)
{
Assert.IsNull(AssemblyHelper.DoesReferencesAssembly(source, AssemblyName.GetAssemblyName(Assembly.GetExecutingAssembly().Location)));
}

[TestMethod]
public void DoesReferencesAssemblyWhenReferenceAssemblyIsNullReturnsNull()
{
Assert.IsNull(AssemblyHelper.DoesReferencesAssembly("C:\\some.dll", null!));
}
}
#endif

0 comments on commit e63ba03

Please sign in to comment.