Skip to content

Commit

Permalink
Revert usage of System.Collections.Immutable for TypeCache
Browse files Browse the repository at this point in the history
We have received some complaints from some users running MSTest on old machines where this package is not available (no .NET installed) causing some runtime load error.
  • Loading branch information
Evangelink committed May 12, 2023
1 parent 1a33b1d commit a7c68c0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Adapter/MSTest.TestAdapter/Execution/TypeCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Globalization;
using System.Linq;
using System.Reflection;
Expand Down Expand Up @@ -72,24 +71,24 @@ internal TypeCache(ReflectHelper reflectionHelper)
/// <summary>
/// Gets Class Info cache which has cleanup methods to execute.
/// </summary>
public ImmutableArray<TestClassInfo> ClassInfoListWithExecutableCleanupMethods =>
_classInfoCache.Values.Where(classInfo => classInfo.HasExecutableCleanupMethod).ToImmutableArray();
public IReadOnlyCollection<TestClassInfo> ClassInfoListWithExecutableCleanupMethods =>
_classInfoCache.Values.Where(classInfo => classInfo.HasExecutableCleanupMethod).ToList();

/// <summary>
/// Gets Assembly Info cache which has cleanup methods to execute.
/// </summary>
public ImmutableArray<TestAssemblyInfo> AssemblyInfoListWithExecutableCleanupMethods =>
_testAssemblyInfoCache.Values.Where(assemblyInfo => assemblyInfo.HasExecutableCleanupMethod).ToImmutableArray();
public IReadOnlyCollection<TestAssemblyInfo> AssemblyInfoListWithExecutableCleanupMethods =>
_testAssemblyInfoCache.Values.Where(assemblyInfo => assemblyInfo.HasExecutableCleanupMethod).ToList();

/// <summary>
/// Gets the set of cached assembly info values.
/// </summary>
public ImmutableArray<TestAssemblyInfo> AssemblyInfoCache => _testAssemblyInfoCache.Values.ToImmutableArray();
public IReadOnlyCollection<TestAssemblyInfo> AssemblyInfoCache => _testAssemblyInfoCache.Values.ToList();

/// <summary>
/// Gets the set of cached class info values.
/// </summary>
public ImmutableArray<TestClassInfo> ClassInfoCache => _classInfoCache.Values.ToImmutableArray();
public IReadOnlyCollection<TestClassInfo> ClassInfoCache => _classInfoCache.Values.ToList();

/// <summary>
/// Get the test method info corresponding to the parameter test Element.
Expand Down

0 comments on commit a7c68c0

Please sign in to comment.