예제 #1
0
        public void TestPassword() {
            var variables = new VariableController();
            var certificate = new CertificateController() {
                Shared = {
                    Variables = variables
                }
            };

            variables.Variable(CommonVariableNames.CommandServerCertificatePath).Value = Path.Combine(Defines.BaseDirectory.FullName, "Remote", "Certificates", "Password.pfx");
            variables.Variable(CommonVariableNames.CommandServerCertificatePassword).Value = "password1";

            certificate.Execute();

            Assert.IsNotNull(certificate.Certificate);
            Assert.IsNotNull(certificate.Certificate.PrivateKey);
        }
예제 #2
0
        public void TestDynamicCreationStringKey() {
            String key = "TestDynamicCreation" + StringExtensions.RandomString(20);

            var variables = new VariableController();

            // Validate the VariableModel does not exist first.
            Assert.IsNull(variables.VolatileVariables.Values.FirstOrDefault(v => v.Name == key));

            // Fetch the VariableModel. This should create and add the VariableModel.
            variables.Variable(key);

            // Now validate that the VariableModel has been added.
            Assert.IsNotNull(variables.VolatileVariables.Values.First(v => v.Name == key));
        }
예제 #3
0
        public void TestDynamicCreationCommonVariableKey() {
            var variables = new VariableController();

            // Validate the VariableModel does not exist first.
            Assert.IsNull(variables.VolatileVariables.Values.FirstOrDefault(v => v.Name == CommonVariableNames.TextCommandPrivatePrefix.ToString()));

            // Fetch the VariableModel. This should create and add the VariableModel.
            variables.Variable(CommonVariableNames.TextCommandPrivatePrefix);

            // Now validate that the VariableModel has been added.
            Assert.IsNotNull(variables.VolatileVariables.Values.First(v => v.Name == CommonVariableNames.TextCommandPrivatePrefix.ToString()));
        }