Fixes for SerialRtuProxy
- Adding UnitTests - Fixing some bugs - Updating UnitTest dependencies
This commit is contained in:
23
AMWD.Protocols.Modbus.Tests/Helper.cs
Normal file
23
AMWD.Protocols.Modbus.Tests/Helper.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace AMWD.Protocols.Modbus.Tests
|
||||
{
|
||||
internal static class Helper
|
||||
{
|
||||
public static T CreateInstance<T>(params object[] args)
|
||||
{
|
||||
var type = typeof(T);
|
||||
|
||||
object instance = type.Assembly.CreateInstance(
|
||||
typeName: type.FullName,
|
||||
ignoreCase: false,
|
||||
bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic,
|
||||
binder: null,
|
||||
args: args,
|
||||
culture: null,
|
||||
activationAttributes: null);
|
||||
|
||||
return (T)instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user