1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 14:54:09 +02:00

New tests

This commit is contained in:
Brian Fiete 2019-11-30 13:18:07 -08:00
parent a4476332fe
commit cbae124dd5
4 changed files with 94 additions and 5 deletions

View file

@ -1,3 +1,5 @@
#pragma warning disable 168
using System;
namespace System.Collections.Generic
@ -24,6 +26,14 @@ namespace System.Collections.Generic
}
}
extension LibClassA
{
public static int GetVal3<T>(T val)
{
return 31;
}
}
namespace Tests
{
class Extensions
@ -170,5 +180,17 @@ namespace Tests
Test.Assert(ca.LibB_GetB() == 8);
Test.Assert(ca.LibC_GetB() == 30013);
}
[Test]
public static void TestExtensionOverride()
{
int a = 123;
int directResult = LibClassA.GetVal3(a);
Test.Assert(directResult == 31);
// This should only call the LibA version since the LibA:LibClassB.DoGetVal3 won't have
// access to call the Tests:LibClassB.DoGetVal3
int indirectResult = LibClassB.DoGetVal3(a);
Test.Assert(directResult == 30);
}
}
}