public void SubtractOperateGivesExpectedOutputWithValidInput() { Subtract test = new Subtract(); Assert.AreEqual("0", test.Operate(2, 2)); Assert.AreEqual("6", test.Operate(8, 2)); Assert.AreEqual("195", test.Operate(200, 5)); Assert.AreEqual("-5", test.Operate(-2, 3)); Assert.AreEqual("0", test.Operate(0, 0)); }
public void WhenXandYMaxValue_ShouldThrowArgumentOutOfRange( [Values(double.MaxValue)] double x, [Values(double.MaxValue)] double y) { var operation = new Subtract(x, y); Assert.AreEqual(0, operation.Operate()); }
public void WhenXMaxValueYMinValue_ShouldArgumentException( [Values(double.MaxValue)] double x, [Values(double.MinValue)] double y) { var operation = new Subtract(x, y); Assert.Throws <ArgumentException>(() => { var result = operation.Operate(); }); }
public void SubtractXYNegative( [Values(-2, -3)] double x, [Values(-4, -5)] double y ) { var operation = new Subtract(x, y); Assert.AreEqual(x - y, operation.Operate()); }
public void SubtractXYPositive( [Values(2, 3)] double x, [Values(4, 5)] double y ) { var operation = new Subtract(x, y); Assert.AreEqual(x - y, operation.Operate()); }