Esempio n. 1
0
        public void ShouldResolveAuthDataType()
        {
            var o = new JwtAuthorizationTicket("ad", "dsa");

            var expected = RpcDataType.AuthTicket;
            var actual   = RpcDataType.ResolveRpcDataType(o);

            Assert.Equal(expected, actual);
        }
Esempio n. 2
0
        public async void ShouldCallTestFunction_Auth()
        {
            const string email = "*****@*****.**";
            const string pass  = "******";

            const int    expectedError      = 0;
            var          expected           = new JwtAuthorizationTicket("access", "refresh");
            const string expectedResultType = "Cadmean.RPC.JwtAuthorizationTicket";

            var output = await rpc.Function("test.auth").Call <JwtAuthorizationTicket>(email, pass);

            Assert.Equal(expectedError, output.Error);

            var actual = output.Result;

            testOutputHelper.WriteLine(actual.ToString());

            Assert.Equal(expected, actual);
            Assert.NotNull(output.MetaData);
            Assert.True(output.MetaData.ContainsKey("clrResultType"));
            Assert.Equal(expectedResultType, output.MetaData["clrResultType"]);
            Assert.Equal(expected, rpc.Configuration.AuthorizationTicketHolder.Ticket);
        }