public void RulesTest() { Arithmetic <int> defaultArithmetic = Arithmetic <int> .Default; Arithmetic <int> arithmetic1 = defaultArithmetic.ApplyRules(new ArithmeticRules(NullBehavior.ThreatNullAsNull, OverflowBehavior.AllowOverflow)); Arithmetic <int> arithmetic2 = arithmetic1.ApplyRules(new ArithmeticRules(NullBehavior.ThreatNullAsZero, OverflowBehavior.DenyOverflow)); Arithmetic <int> arithmetic3 = defaultArithmetic.ApplyRules(new ArithmeticRules(NullBehavior.ThreatNullAsNull, OverflowBehavior.AllowOverflow)); Assert.AreEqual(arithmetic1, arithmetic3); Assert.AreNotEqual(arithmetic1, arithmetic2); }