Example #1
0
        public void TestNullable()
        {
            var t      = new Tracer();
            var person = new Person();

            var p = PropertyProxy <IPerson> .Create(person, t);

            // null nullable
            Assert.Null(p.BirthYear);
            Assert.Equal(new Tracer()
            {
                { "BirthYear", new Tracer() },
            }, t);

            // non null nullable
            t.Clear();
            Assert.Empty(t);

            person.BirthYear = 1970;

            Assert.Equal(1970, p.BirthYear);
            Assert.Equal(new Tracer()
            {
                { "BirthYear", new Tracer() },
            }, t);
        }
Example #2
0
        public void TestListenEnum()
        {
            var t = new Tracer();

            var p = PropertyProxy <IPerson> .Create(new Person()
            {
                Gender = Gender.Female
            }, t);

            Assert.Equal <Gender>(Gender.Female, p.Gender);
            Assert.Equal(new Tracer()
            {
                { "Gender", new Tracer() }
            }, t);
        }