OperationResult
2015-12-13 20:59
225 查看
public class OperationResult<T> { private readonly ConcurrentDictionary<string, T> _values = new ConcurrentDictionary<string, T>(); public OperationResult() { } public OperationResult(bool success) : this(success, String.Empty) { } public OperationResult(string message) : this(false, message) { } public OperationResult(bool success, string message) : this() { Success = success; Message = message; } public int Count { get { return _values.Count; } } public T this[string key] { get { return _values[key]; } set { _values[key] = value; } } public string Message { get; set; } public bool Success { get; set; } public override string ToString() { return String.Format("{0}:{1}{2}", Success ? "PASS" : "FAIL", Message, Count == 0 ? String.Empty : String.Format("({0})", String.Join(";", _values.OrderBy(o => o.Key) .Select(s => String.Format("{0}:\"{1}\"", s.Key, s.Value))))); } }
相关文章推荐
- 端口映射,在内网映射外网,利用P2P实现外面跨网穿透nat访问内网80网站和应用
- Linux_SquidProxyServer代理服务器
- RadioButton的drawableTop资源大小调整
- Linux编译
- Hadoop2.0的HA介绍
- uva 10271——Chopsticks
- OpenGL ES 三种类型修饰 uniform attribute varying
- 网站技巧
- openstack controller ha测试环境搭建记录(六)——配置keystone
- [BZOJ1688] [Usaco2005 Open]Disease Manangement 疾病管理
- VS2015配置OpenMVS流程
- linux windows Tomcat内存优化
- ARMv8 内存管理架构.学习笔记
- ARMv8 架构与指令集.学习笔记
- 2个不错的介绍前端网站
- 网站架构要素
- strong和copy的区别
- Apache conf文件配置个人总结
- 真机测试时出现 could not find developer disk image问题
- JVM监控使用