c# core: .net 3.5 compatibiity fix for unit test case