public void FHLBApp()
 {
     //create local share
     var path = new DotNetPath();
     var x = path.ConvertUncShareToLocalPath(new DeploymentServer("sellersd"), @"~\FHLBWinSvc\Bill");
     Assert.AreEqual("D:\\Development\\cue_dep\\Shares\\FHLBWinSvc\\Bill", x);
     //remove local share
 }
        public void when_deploying_to_temp_share_should_convert_remote_path_successfully()
        {
            var path = new DotNetPath();

            string serverName = "127.0.0.1";
            string shareName = "yoyotemp";
            string destination = @".\temp";
            string sub_folder = "Bill";

            if (!Directory.Exists(destination)) {Directory.CreateDirectory(destination);}

            Win32Share.Create(serverName, shareName, destination, "yoyo");
            var x = path.ConvertUncShareToLocalPath(new DeploymentServer(serverName), @"~\{0}\{1}".FormatWith(shareName,sub_folder));
            Win32Share.Delete(serverName, shareName);

            Assert.AreEqual(Path.GetFullPath(Path.Combine(destination,sub_folder)) , x);
        }
        public DeploymentResult Execute()
        {
            var result = new DeploymentResult();
            var to = new DotNetPath().GetFullPath(_to);

            var toParent = GetRootShare(to);
            try 
            {
                using(var context = Authenticator.BeginFileShareAuthentication(toParent, _userName, _password))
                {
                    result.AddGood("'{0}' authenticated with {1}.".FormatWith(to, _userName));
                }
            }
            catch(Exception err)
            {
                result.AddError("Failed to access '{0}' as user '{1}'".FormatWith(toParent, _userName), err);
            }
            return result;
        }
  public DeploymentResult VerifyCanRun()
  {
      var result = new DeploymentResult();
      var to = new DotNetPath().GetFullPath(_to);
      string toParent = GetRootShare(to);
      try 
      {
          using(var context = Authenticator.BeginFileShareAuthentication(toParent, _userName, _password))
          {
              result.AddGood(System.IO.Directory.Exists(to) ? "'{0}' already exists.".FormatWith(to) : Name);
          }
      }
      catch(Exception err)
      {
          result.AddError("Failed to access '{0}' as user '{1}'".FormatWith(toParent, _userName), err);
      }
      //TODO figure out a good verify step...
      return result;
 }
 public void when_deploying_to_c_share_should_convert_remote_path_successfully()
 {
     var path = new DotNetPath();
     var x = path.ConvertUncShareToLocalPath(new DeploymentServer("127.0.0.1"), @"~\c$\Bill");
     Assert.AreEqual("C:\\Bill", x);
 }
 public ProtoNServiceBusInstallTask(DotNetPath path, string location)
 {
     _path = path;
     _location = location;
 }