示例#1
0
        public void RDTest()
        {
            Ref <double> rd = Ref.Bind(0d);
            int          i  = 0;

            Assert.True(rd.Value == i);
            Assert.True(i == rd.Value);
            Assert.False(rd.RefValue == (object)i);
            Assert.False((object)i == rd.RefValue);
            Assert.False(rd == i);
            Assert.False(i == rd);

            Assert.False(rd.Value != i);
            Assert.False(i != rd.Value);
            Assert.True(rd.RefValue != (object)i);
            Assert.True((object)i != rd.RefValue);
            Assert.True(rd != i);
            Assert.True(i != rd);

            Assert.False(rd.Equals(i));
            Assert.False(i.Equals(rd));
        }
示例#2
0
        public void RITest()
        {
            Ref <int> ri = Ref.Bind(0);
            int       i  = 0;

            Assert.True(ri.Value == i);
            Assert.True(i == ri.Value);
            Assert.False(ri.RefValue == (object)i);
            Assert.False((object)i == ri.RefValue);
            Assert.False(ri == i);
            Assert.False(i == ri);

            Assert.False(ri.Value != i);
            Assert.False(i != ri.Value);
            Assert.True(ri.RefValue != (object)i);
            Assert.True((object)i != ri.RefValue);
            Assert.True(ri != i);
            Assert.True(i != ri);

            Assert.True(ri.Equals(i));
            Assert.True(i.Equals(ri));
        }