Пример #1
0
        public void CanDeserializeMemberTypeSetting()
        {
            const string serializedString = @"Fields||1||Member Variables";

            var memberTypeSetting = MemberTypeSetting.Deserialize(serializedString);

            Assert.IsNotNull(memberTypeSetting);
            Assert.AreEqual(memberTypeSetting.DefaultName, "Fields");
            Assert.AreEqual(memberTypeSetting.EffectiveName, "Member Variables");
            Assert.AreEqual(memberTypeSetting.Order, 1);
        }
Пример #2
0
        /// <summary>
        /// Loads the settings.
        /// </summary>
        public override void LoadSettings()
        {
            Classes      = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeClasses);
            Constructors = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeConstructors);
            Delegates    = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeDelegates);
            Destructors  = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeDestructors);
            Enums        = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeEnums);
            Events       = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeEvents);
            Fields       = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeFields);
            Indexers     = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeIndexers);
            Interfaces   = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeInterfaces);
            Methods      = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeMethods);
            Properties   = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeProperties);
            Structs      = MemberTypeSetting.Deserialize(Settings.Default.Reorganizing_MemberTypeStructs);

            CreateMemberTypesFromCurrentState();
        }
Пример #3
0
        public void TestInitialize()
        {
            Settings.Default.Reset();

            _lookupCount   = 0;
            _parseCount    = 0;
            _cachedSetting = new CachedSetting <MemberTypeSetting>(
                () =>
            {
                _lookupCount++;
                return(Settings.Default.Reorganizing_MemberTypeFields);
            },
                x =>
            {
                _parseCount++;
                return(MemberTypeSetting.Deserialize(x));
            });

            Assert.AreEqual(0, _lookupCount);
            Assert.AreEqual(0, _parseCount);
            Assert.IsNotNull(_cachedSetting);
        }