ArgsTests.SetupCleanup.ClearAttributeCache C# (CSharp) Метод

ClearAttributeCache() публичный статический Метод

public static ClearAttributeCache ( ) : void
Результат void
        public static void ClearAttributeCache()
        {
            MemberInfoEx.cachedAttributes.Clear();
        }

Usage Example

        public void TestREPLReset()
        {
            SetupCleanup.ClearAttributeCache();
            var provider = TestConsoleProvider.SimulateConsoleInput("-b{enter}-s a{enter}quit");
            var def      = new CommandLineArgumentsDefinition(typeof(TestArgsWithREPL));
            var boolArg  = def.FindMatchingArgument("b");

            Assert.IsNotNull(boolArg);

            bool first         = true;
            bool validatedBoth = false;
            var  interceptor   = new AfterInvokeInterceptor((context) =>
            {
                if (first)
                {
                    first = false;
                    Assert.IsTrue((bool)boolArg.RevivedValue);
                }
                else
                {
                    Assert.IsNull(boolArg.RevivedValue);
                    validatedBoth = true;
                }
            });

            def.Metadata.Add(interceptor);

            var finalResult = Args.InvokeMain(def, "$");

            Assert.IsTrue(validatedBoth);
            Assert.IsFalse((finalResult.Value as TestArgsWithREPL).BoolParam);
        }