Good day! I'm probably just something simple I missed, but I was plagued by doubts.
And so what's the problem. Is the property
short BaseGene<short>.Code { get; set; }</short>
It seems there's no catch, but if you spend any manipulations with unit testing with property, for example:
Assert.IsNotNull(gene.Code);
the dotnet says: "I'm outta here: 0xc00000fd" and in console says "Process is terminating due to StackOverflowException.".
hetero and cetery:
public T Code { get => Code; set => Code = value; }
I don't understand where overflow occurs understand would be an infinite loop, but no...
Even if:
GeneInt16 gene = new GeneInt16();
Assert.IsNotNull(gene);
And in the constructor
public GeneInt16(int? seed = null, short min = short.MinValue, short max = short.MaxValue)
{
_random = (seed == null) ? new Random() : new Random((int)seed);
Code = (short)_random.Next(min, max);
}
The same thing happens.
If at all, to ignore the existence of the Code, all OK, the tests passed.
Important note, if you just compile the project and use it, everything is fine.
Code {get;set;}
- Alize_Moen commented on June 8th 19 at 16:38