Exemplo n.º 1
0
        public void ActionGetToken()
        {
            var registro = GetRegistroToken();

            fakedContext.Initialize(new List <Entity>()
            {
                registro
            });
            var inputs = new Dictionary <string, Object> {
                { "TokenConfig", registro.ToEntityReference() }
            };
            var codeActivity = new JwtTokenAction();
            var result1      = fakedContext.ExecuteCodeActivity <JwtTokenAction>(wfContext, inputs, codeActivity);

            Assert.IsTrue((bool)result1["Sucess"], (string)result1["Message"]);
        }
Exemplo n.º 2
0
        public void ActionGetTokenDoCache()
        {
            var registro = GetRegistroToken();

            registro["sad_data_expiracao"] = DateTime.Now;
            registro["sad_valor_token"]    = "xxxxxxxxxxxxx";

            fakedContext.Initialize(new List <Entity>()
            {
                registro
            });
            var inputs = new Dictionary <string, Object> {
                { "TokenConfig", registro.ToEntityReference() }
            };
            var codeActivity = new JwtTokenAction();
            var result1      = fakedContext.ExecuteCodeActivity <JwtTokenAction>(wfContext, inputs, codeActivity);

            Assert.IsTrue((bool)result1["Sucess"], (string)result1["Message"]);
        }