public Regenton(RegentonSizes size, int content) { Capacity = ConvertSizeToInt(size); if (content > Capacity) { content = Capacity; } Content = content; }
private static int ConvertSizeToInt(RegentonSizes size) { return(size switch { RegentonSizes.Small => 80, RegentonSizes.Medium => 120, RegentonSizes.Large => 160, _ => 80, });
public void Constructor_SizeSetCorrectCapacity(RegentonSizes size, int expectedCapacity) { //Arrange Regenton testRegenTon; //Act testRegenTon = new Regenton(size); //Assert Assert.AreEqual(expectedCapacity, testRegenTon.Capacity); }
public Regenton(RegentonSizes size) : this(size, 0) { }