Exemple #1
0
 public Regenton(RegentonSizes size, int content)
 {
     Capacity = ConvertSizeToInt(size);
     if (content > Capacity)
     {
         content = Capacity;
     }
     Content = content;
 }
Exemple #2
0
 private static int ConvertSizeToInt(RegentonSizes size)
 {
     return(size switch
     {
         RegentonSizes.Small => 80,
         RegentonSizes.Medium => 120,
         RegentonSizes.Large => 160,
         _ => 80,
     });
Exemple #3
0
        public void Constructor_SizeSetCorrectCapacity(RegentonSizes size, int expectedCapacity)
        {
            //Arrange
            Regenton testRegenTon;

            //Act
            testRegenTon = new Regenton(size);

            //Assert
            Assert.AreEqual(expectedCapacity, testRegenTon.Capacity);
        }
Exemple #4
0
 public Regenton(RegentonSizes size) : this(size, 0)
 {
 }