Comments (3)
写成单元测试,提交PR进来,我找不到合适的单元测试用例
from x.
支持String[] 有问题
[DisplayName("看门狗配置")]
[Config("Watch")]
class Settings : Config<Settings>
{
/// <summary>看护的程序完整路径及名称</summary>
[Description("看护的程序完整路径及名称")]
public String WatchProgramFullName { get; set; } = "";
/// <summary>第二组开始的程序启动间隔时间(毫秒)</summary>
[Description("第二组开始的程序启动间隔时间(毫秒)")]
public int StartSecondProgramWaitTime { get; set; } = 1000;
/// <summary>看护的程序名称(不包含后缀)</summary>
[Description("第二组看护的程序名称列表(不包含后缀)")]
public String[] SecondWatchProgramFullNames { get; set; } = { "" };
}
报错信息
21:13:58.253 4 Y - System.Exception: 创建对象失败 type=System.String parameters= 没有为该对象定义无参数的构造函数。 ---> System.MissingMethodException: 没有为该对象定义无参数的构造函数。
在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
在 System.Activator.CreateInstance(Type type, Boolean nonPublic)
在 NewLife.Reflection.DefaultReflect.CreateInstance(Type type, Object[] parameters) 位置 D:\X\Src\NewLife.Core\Reflection\IReflect.cs:行号 412
--- 内部异常堆栈跟踪的结尾 ---
在 NewLife.Reflection.DefaultReflect.CreateInstance(Type type, Object[] parameters) 位置 D:\X\Src\NewLife.Core\Reflection\IReflect.cs:行号 419
在 NewLife.Configuration.ConfigProvider.MapArray(IConfigSection section, Object model, PropertyInfo pi) 位置 D:\X\Src\NewLife.Core\Configuration\IConfigProvider.cs:行号 272
在 NewLife.Configuration.ConfigProvider.MapTo(IConfigSection section, Object model) 位置 D:\X\Src\NewLife.Core\Configuration\IConfigProvider.cs:行号 233
在 NewLife.Configuration.FileConfigProvider.Watch_Changed(Object sender, FileSystemEventArgs e) 位置 D:\X\Src\NewLife.Core\Configuration\FileConfigProvider.cs:行号 181
from x.
问题已修正,单元测试通过
Json/Xml配置文件支持字符串数组,单元测试覆盖通过
32e0342
from x.
Related Issues (20)
- Snowflake使用Autofac会出现时间倒退问题 HOT 2
- NewLife.Core自动加载dll
- 部分机型读取不到电池电量 HOT 2
- 压缩文件.zip问题 HOT 7
- Socket.OSSupportsIPv6 不支持Xamarin.Android HOT 2
- NewLife.Hive套接字连接出错 HOT 3
- 最新版10.2.2023.401中NewLife.Caching把redis删掉了? HOT 1
- HashSet 初始化遗漏参数 excludes
- X
- func greet(person: String, day: String) -> String { return "Hello \(person), today is \(day)." } greet(person: "Bob", day: "Tuesday") HOT 1
- func greet(person: String, day: String) -> String { return "Hello \(person), today is \(day)." } greet(person: "seabass", day: "saturday") HOT 1
- CsvDb存储第一行表头错误 HOT 1
- 使用StaticFilesHandler 时文件会被一直占用 HOT 1
- 对于JValue对象的ToJson()方法,会报错 HOT 2
- Sample
- Log代码无法自定义文件夹输出日志 HOT 2
- 801升级到1201后报 Not Found InterNetworkV6 HOT 1
- Config以及Log文件夹能否不自动生成,有配置入口吗 HOT 2
- ICache 能否增加一个 IDictionary<TKey,TValue> GetDictionary<TKey,TValue>(String key); HOT 2
- HttpServer怎么实现Server-Sent Event(SSE)功能 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x.