示例#1
0
        public void Range_Minus_ClassImplementingMinus()
        {
            var r = Range.FromPoint(new ClassWithMinusOperatorOverloading());

            Assert.DoesNotThrow(() =>
            {
                var i = r.Length;
            });
        }
示例#2
0
        public void Range_SinglePoint()
        {
            var r = Range.FromPoint(5);

            Assert.That(r.From, Is.EqualTo(r.To));
        }
示例#3
0
        public void Range_Minus_ClassNotImplementingMinus_ThrowsRuntimeBinderException()
        {
            var r = Range.FromPoint(new ClassWithoutMinusOperatorOverloading());

            Assert.That(() => r.Length, Throws.TypeOf <RuntimeBinderException>());
        }
示例#4
0
        public void Range_FromPoint_ToString()
        {
            var r = Range.FromPoint <double>(5);

            Assert.That(r.ToString(), Is.EqualTo("5-5"));
        }