예제 #1
0
        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());
        }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }
예제 #4
0
        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());
        }
예제 #5
0
        public void Solo([Random(100)] int a)
        {
            ModifiableInt i = new ModifiableInt(a);

            Assert.AreEqual(a, i.Evaluate());
        }