public void OverflowMul() { int a = (int)1e9, b = (int)1e9; ModifiableInt i = new ModifiableInt(a); i.Modifiers.Add(new MultiplyModifierInt(b)); Assert.DoesNotThrow(() => i.Evaluate()); }
public void Div( [Random(-99999, 99999, 10)] int a, [Values(-24, -99, -1, 1, 2, 3, 10, 99)] int b) { ModifiableInt i = new ModifiableInt(a); i.Modifiers.Add(new DivisionModifierInt(b)); Assert.AreEqual(a / b, i.Evaluate()); }
public void Sub( [Random(-99999, 99999, 10)] int a, [Random(-99999, 99999, 10)] int b) { ModifiableInt i = new ModifiableInt(a); i.Modifiers.Add(new SubtractiveModifierInt(b)); Assert.AreEqual(a - b, i.Evaluate()); }
public void Mul( [Random(-99999, 99999, 10)] int a, [Random(-99, 99, 5)] int b) { ModifiableInt i = new ModifiableInt(a); i.Modifiers.Add(new MultiplyModifierInt(b)); Assert.AreEqual(a * b, i.Evaluate()); }
public void Solo([Random(100)] int a) { ModifiableInt i = new ModifiableInt(a); Assert.AreEqual(a, i.Evaluate()); }