public CylinderVolumeTest() { var random = new Random(); Radius = random.Next(1, 20); Height = random.Next(1, 40); Volume = Radius * Height; Cylinder = new Cyclinder(Radius, Height); }
public static decimal Volume(this Cyclinder cylinder) { try { if (cylinder != null) { return(cylinder.Height * cylinder.Radius); } return(0); } catch (Exception) { throw; } }