private static()

in src/Testing/Emulator/Policies/CacheStoreHandler.cs [40:63]


    private static (uint, bool) ExtractParameters(object?[]? args)
    {
        if (args is not { Length: 1 or 2 })
        {
            throw new ArgumentException("Expected 1 or 2 arguments", nameof(args));
        }

        if (args[0] is not uint duration)
        {
            throw new ArgumentException($"Expected {typeof(uint).Name} as first argument", nameof(args));
        }

        if (args.Length != 2)
        {
            return (duration, true);
        }

        if (args[0] is not bool cacheValue)
        {
            throw new ArgumentException($"Expected {typeof(bool).Name} as second argument", nameof(args));
        }

        return (duration, cacheValue);
    }