public void Range_Minus_ClassImplementingMinus() { var r = Range.FromPoint(new ClassWithMinusOperatorOverloading()); Assert.DoesNotThrow(() => { var i = r.Length; }); }
public void Range_SinglePoint() { var r = Range.FromPoint(5); Assert.That(r.From, Is.EqualTo(r.To)); }
public void Range_Minus_ClassNotImplementingMinus_ThrowsRuntimeBinderException() { var r = Range.FromPoint(new ClassWithoutMinusOperatorOverloading()); Assert.That(() => r.Length, Throws.TypeOf <RuntimeBinderException>()); }
public void Range_FromPoint_ToString() { var r = Range.FromPoint <double>(5); Assert.That(r.ToString(), Is.EqualTo("5-5")); }