public void CreateInterceptableProperty_Adds_Fields_Property_Methods_And_Mapping()
        {
            var moduleScope    = new ModuleScope();
            var generator      = new ProxyGenerator(moduleScope);
            var typeDefinition = generator.GetTypeDefinition(typeof(TypeScope1), null, null);

            TypeBuilder typeBulder = moduleScope.Module.DefineType(typeDefinition.FullName, typeDefinition.TypeAttributes);

            var proxyScope = new ProxyScope(moduleScope, typeBulder, typeDefinition);

            //  proxyScope.DefineTypeAndMembers();

            proxyScope.GetType().GetMethod("CreateFields", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(proxyScope, new object[0]);

            Assert.AreEqual(1, proxyScope.Fields.Count);
            Assert.AreEqual(0, proxyScope.Properties.Count);
            Assert.AreEqual(0, proxyScope.Methods.Count);

            var propertyBuilder = proxyScope.CreateInterceptableProperty(typeDefinition.PropertyDefinitions[0]);

            Assert.AreEqual(4, proxyScope.Fields.Count);
            Assert.AreEqual("TypeScope1_MyProperty", proxyScope.Fields[1].Name);
            Assert.AreEqual("TypeScope1_Proxy_get_MyProperty", proxyScope.Fields[2].Name);
            Assert.AreEqual("TypeScope1_Proxy_set_MyProperty", proxyScope.Fields[3].Name);

            Assert.AreEqual(4, proxyScope.Methods.Count);
            Assert.AreEqual("get_MyProperty_Callback", proxyScope.Methods[0].Name);
            Assert.AreEqual("get_MyProperty", proxyScope.Methods[1].Name);
            Assert.AreEqual("set_MyProperty_Callback", proxyScope.Methods[2].Name);
            Assert.AreEqual("set_MyProperty", proxyScope.Methods[3].Name);

            var acc = new TypeAccessor(proxyScope);

            var mappings = acc.Fields["propertyMappings"].GetValue() as List <PropertyMapping>;

            Assert.AreEqual(1, mappings.Count);
            Assert.AreEqual("TypeScope1_MyProperty", mappings[0].MemberField.Name);
            Assert.AreEqual("TypeScope1_Proxy_get_MyProperty", mappings[0].GetMethodField.Name);
            Assert.AreEqual("TypeScope1_Proxy_set_MyProperty", mappings[0].SetMethodField.Name);

            Assert.AreEqual("MyProperty", mappings[0].Property.Name);
            Assert.AreEqual("get_MyProperty", mappings[0].GetMethodBuilder.Name);
            Assert.AreEqual("set_MyProperty", mappings[0].SetMethodBuilder.Name);
        }