public void Should_be_possible_to_encapsulate_target_info() { var mockCryptoProvider = CreateMockCryptoProvider(EMPTY_DOMAIN); var targetParameters = new TargetParameters( FAKE_ADDRESS, FAKE_USERNAME, FAKE_PASSWORD, "", FakeCertificate, mockCryptoProvider); Assert.AreEqual("10.1.1.1", targetParameters.Address, UNEXPECTED_TARGET_ADDRESS_FOUND); Assert.IsFalse(String.IsNullOrWhiteSpace(targetParameters.EncryptedCredentials), "The encrypted credentials cannot be null."); mockCryptoProvider .AssertWasCalled( crypto => crypto.EncryptCredential(FakeCertificate, EMPTY_DOMAIN, FAKE_USERNAME, FAKE_PASSWORD, "")); }
public void Start(string[] args) { if (!PrepareOptions(args)) { return; } var operation = CheckParameters(); if (operation == Operation.Error) { view.ShowMessage(System.Environment.NewLine); view.ShowMessage(options.GetUsage()); return; } ProcessParameters(); if (operation == Operation.SendCollect || operation == Operation.SendCollectSync) { if (!ValidateSchema()) { return; } if (options.ValidateSchematron) { if (!ValidadeSchematron()) { return; } } var certificate = GetCertificate(); target = new TargetParameters( options.TargetAddress, options.TargetUsername, options.TargetPassword, options.TargetAdministrativePassword, certificate); } Execute(operation); }
public void Start(string[] args) { if (!PrepareOptions(args)) return; var operation = CheckParameters(); if (operation == Operation.Error) { view.ShowMessage(System.Environment.NewLine); view.ShowMessage(options.GetUsage()); return; } ProcessParameters(); if (operation == Operation.SendCollect || operation == Operation.SendCollectSync) { if (!ValidateSchema()) return; if (options.ValidateSchematron) { if (!ValidadeSchematron()) return; } var certificate = GetCertificate(); target = new TargetParameters( options.TargetAddress, options.TargetUsername, options.TargetPassword, options.TargetAdministrativePassword, certificate); } Execute(operation); }