public void Instance() { Foo foo = new Foo(); var fooReflection = foo.Reflection(); #if !SILVERLIGHT // Silverlight does not allow access to private members through reflection Assert.Equal(foo.I, fooReflection.Get("i")); fooReflection.Set("i", 2); Assert.Equal(2, foo.I); Assert.Equal(2, fooReflection.Get("I")); #endif fooReflection.Set("I", 3); Assert.Equal(3, foo.I); Assert.Equal(3, fooReflection.Get("GetI")); fooReflection.Set("SetI", 4); Assert.Equal(4, foo.I); }