public void InvokeCallsNth()
        {
            CPV v = new CPV(new object[] { 5, 6, 7 });

            Expect(v.invoke(0), EqualTo(5));
            Expect(v.invoke(1), EqualTo(6));
            Expect(v.invoke(2), EqualTo(7));
            Expect(v.invoke("1"), EqualTo(6));
            Expect(v.invoke(1.0), EqualTo(6));
            Expect(v.invoke(1.2), EqualTo(6));
            Expect(v.invoke(1.8), EqualTo(6)); // Rounds or not-- should it?
            Expect(v.invoke(1.4M), EqualTo(6));
        }
Esempio n. 2
0
        public void InvokeCallsNth()
        {
            CPV v = new CPV(new object[] { 5, 6, 7 });

            Expect(v.invoke(0)).To.Equal(5);
            Expect(v.invoke(1)).To.Equal(6);
            Expect(v.invoke(2)).To.Equal(7);
            Expect(v.invoke("1")).To.Equal(6);
            Expect(v.invoke(1.0)).To.Equal(6);
            Expect(v.invoke(1.2)).To.Equal(6);
            Expect(v.invoke(1.8)).To.Equal(6); // Rounds or not-- should it?
            Expect(v.invoke(1.4M)).To.Equal(6);
        }
        public void InvokeCallsNth()
        {
            CPV v = new CPV(new object[] { 5, 6, 7 });

            Expect(v.invoke(0),EqualTo(5));
            Expect(v.invoke(1),EqualTo(6));
            Expect(v.invoke(2),EqualTo(7));
            Expect(v.invoke("1"), EqualTo(6));
            Expect(v.invoke(1.0), EqualTo(6));
            Expect(v.invoke(1.2), EqualTo(6));
            Expect(v.invoke(1.8), EqualTo(6)); // Rounds or not-- should it?
            Expect(v.invoke(1.4M), EqualTo(6));
        }