示例#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()));
        }