Esempio n. 1
0
        public void TestFromFile()
        {
            var generator = JwtGeneratorFactory.CreateGeneratorWithFilePath(_mockAppId, "./mock.key");
            var jwt       = generator.GenerateJwt();
            var decoded   = JsonConvert.DeserializeObject <JObject>(generator.DecodeJwt(jwt));

            Assert.Equal(_mockAppId, decoded["application_id"].ToString());
        }
Esempio n. 2
0
 public void TestBadPath()
 {
     try
     {
         JwtGeneratorFactory.CreateGeneratorWithFilePath(_mockAppId, "./not/a/valid/path.key");
     }
     catch (FileNotFoundException ex)
     {
         Assert.Equal("No ./not/a/valid/path.key file found", ex.Message);
     }
 }