public void Successfully_RegisterStaticFunctions()
        {
            var registry = new FunctionRegistry();

            registry.RegisterType(typeof(FunctionContainer));
            var conf = new RollerConfig()
            {
                FunctionRegistry = registry, GetRandomBytes = GetRNG(Roll9())
            };

            EvaluateRoll("1d20.a()", conf, 1, "1d20.a() => 9 => 10");
        }
        public void Successfully_RegisterAllFunctions()
        {
            var registry = new FunctionRegistry();
            var cont     = new FunctionContainer(2);

            registry.RegisterType(cont);
            Assert.IsTrue(registry.Contains("a", FunctionScope.Basic));
            Assert.IsTrue(registry.Contains("b", FunctionScope.Global));
            Assert.IsFalse(registry.Contains("c", FunctionScope.Global));

            var conf = new RollerConfig()
            {
                FunctionRegistry = registry, GetRandomBytes = GetRNG(Roll9())
            };

            EvaluateRoll("1d20.a()", conf, 1, "1d20.a() => 9 => 10");
            EvaluateRoll("1d20.b()", conf, 1, "1d20.b() => 9 => 11");
            EvaluateRoll("b()", conf, 0, "b() => 2 => 2");
        }
        public void ThrowInvalidOperationException_WhenDuplicatingFunctionWithAll_Type()
        {
            var registry = new FunctionRegistry();

            registry.RegisterType(typeof(Invalid2));
        }
        public void ThrowInvalidOperationException_WhenDuplicatingRollFunction()
        {
            var registry = new FunctionRegistry();

            registry.RegisterType(new Invalid4());
        }
        public void ThrowArgumentNullException_WhenNullDiceFunctionAttribute()
        {
            var registry = new FunctionRegistry();

            registry.RegisterType(typeof(Invalid3));
        }