Ad
  • Custom User Avatar

    is exactly the other way round. It passes -7 to the constructor and checks for 7. This test case should be ok.

        Cube c = new Cube(-7);
        Assert.AreEqual(7, c.GetSide(), "Should be 7");
    
  • Custom User Avatar

    Kaka's description said to throw ArgumentException if the input was "0". If I didn't have the else it would return 0.

    But yeah if you mean that the code terminate after the return anyway, then yeah. Just looks better with the else to me.