using System; using Xunit; using k8s; using System.IO; namespace k8s.Tests { public class KubernetesClientCredentialsTests { /// /// Checks that a ArgumentNullException is thrown when trying to create a KubernetesClientCredentials with null token /// [Fact] public void TokenNull() { Assert.Throws(() => new KubernetesClientCredentials(null)); } /// /// Checks that a ArgumentNullException is thrown when trying to create a KubernetesClientCredentials with null username /// [Fact] public void UsernameNull() { Assert.Throws(() => new KubernetesClientCredentials(null,"password")); } /// /// Checks that a ArgumentNullException is thrown when trying to create a KubernetesClientCredentials with null password /// [Fact] public void PasswordNull() { Assert.Throws(() => new KubernetesClientCredentials("username", null)); } /// /// Checks that the Token is set with no exceptions /// [Fact] public void ValidTokenIsSet() { var token = "mytoken"; var credentials = new KubernetesClientCredentials(token); Assert.NotNull(credentials); } /// /// Checks that the Username and Password is set with no exceptions /// [Fact] public void ValidUserPasswordIsSet() { var username = "myuser"; var password = "mypassword"; var credentials = new KubernetesClientCredentials(username, password); Assert.NotNull(credentials); } } }