public void CalculateTest() { var operation = new DivOperation { A = 2, B = 8 }; operation.Calculate(); Assert.IsTrue(operation.Result != null); Assert.IsTrue(operation.Result.Value == 0.25); }
public void ZeroDevisionTest() { try { var operation = new DivOperation { A = 2, B = 0 }; operation.Calculate(); throw new AssertFailedException("Деление на ноль невозможно"); } catch (ArgumentException) { } }