实战中这样的类,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;
}
标签:int,子类,Father,protected,nothing,父类,Shize,public,构造函数
From: https://www.cnblogs.com/occulter/p/17227999.html