Enable ArchiSteamFarm.Tests for net472

This commit is contained in:
JustArchi
2018-06-11 01:29:08 +02:00
parent fca4611160
commit c966dd13b7
2 changed files with 6 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
<PackageProjectUrl>https://github.com/JustArchi/ArchiSteamFarm</PackageProjectUrl>
<RepositoryType>Git</RepositoryType>
<RepositoryUrl>https://github.com/JustArchi/ArchiSteamFarm.git</RepositoryUrl>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">

View File

@@ -195,6 +195,11 @@ namespace ArchiSteamFarm.Tests {
private static bool AcceptsTrade(IReadOnlyCollection<Steam.Asset> inventory, IReadOnlyCollection<Steam.Asset> itemsToGive, IReadOnlyCollection<Steam.Asset> itemsToReceive) {
Type trading = typeof(ArchiSteamFarm.Trading);
MethodInfo method = trading.GetMethod("IsTradeNeutralOrBetter", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
if (method == null) {
throw new ArgumentNullException(nameof(method));
}
return (bool) method.Invoke(null, new object[] { inventory, itemsToGive, itemsToReceive });
}