public void Area_2_4_8() { double a = 2, b = 4, c = 8; double expected = 4; double actual = TriangleArea.Area(a, b, c); Assert.AreEqual(expected, actual); }
public void Area_3_4_5() { double a = 3, b = 4, c = 5; double expected = 6; double actual = TriangleArea.Area(a, b, c); Assert.AreEqual(expected, actual); }
public void RightValues_Test() { // Arrange double a = 6; double b = 8; double c = 10; double area1 = 24; double area2 = TriangleArea.Area(a, b, c); Assert.AreEqual(area1, area2); }
public void TriangleExists_Test() { double a = 1; double b = 2; double c = 3; try { TriangleArea.Area(a, b, c); } catch (ArgumentException e) { StringAssert.Contains(e.Message, ConstMessage.WrongValues); } }
public void SquaredParametersInfinity_Test() { double a = double.MaxValue / 2; double b = 15; double c = double.MaxValue - 10; try { TriangleArea.Area(a, b, c); } catch (ArgumentException e) { StringAssert.Contains(e.Message, ConstMessage.SquaredParameterInfinity); } }
public void IncorrectLegLength_Test() { double a = 9; double b = 9; double c = 8; try { TriangleArea.Area(a, b, c); } catch (ArgumentException e) { StringAssert.Contains(e.Message, ConstMessage.TwoBigEqualsSides); } }
public void NegativeValue_Test() { // Arrange double a = -6; double b = 8; double c = 10; try { TriangleArea.Area(a, b, c); } catch (ArgumentException e) { StringAssert.Contains(e.Message, ConstMessage.NegativeValues); } }