예제 #1
0
        public async Task AuthTestWithoutLogin()
        {
            using var client = new CdnClient(Constants.BaseUrl);
            (bool success, string message) = await client.TestAuthentication();

            Assert.IsFalse(success);
            Assert.IsNull(message);
        }
예제 #2
0
        public async Task LoginAuthTest()
        {
            using var client = new CdnClient(Constants.BaseUrl);
            await client.Login("admin", "password");

            (bool success, string message) = await client.TestAuthentication();

            Assert.IsTrue(success);
            Assert.IsNotEmpty(message);
        }
예제 #3
0
        public async Task GetApiKeyAndTestAuthentication()
        {
            using var client = new CdnClient(Constants.BaseUrl);
            await client.Login("admin", "password");

            var tokenMaybe = await client.GetApiKey();

            Assert.IsTrue(tokenMaybe.HasValue);
            Assert.IsNotEmpty(tokenMaybe.Value);
            (bool success, string message) = await client.TestAuthentication();

            Assert.IsTrue(success);
            Assert.IsNotEmpty(message);
        }