征服野蛮人  

实战中这样的类,Shize保持了原始值, 但单元测试,又是好的,很奇怪。

public abstract class GrandPa 
{
    protected int Nothing;
    protected GrandPa(int nothing)=> Nothing = nothing;

}

public abstract class Father : GrandPa
{
    protected readonly long Shize;
    protected Father(int nothing): base(nothing)
    {
        Shize = DateTime.Now.ToTimeStampInSecond();
    }
}
public class Son : Father
{
    public Son(int nothing) : base(nothing)
    {
    }
    public long GetShiZe() => Shize;
}
posted on 2023-03-17 19:52  征服野蛮人  阅读(13)  评论(0编辑  收藏  举报