public void TestPublishFilesImpersonateNoMachineName() { WNetCancelConnection2(TestSharePrivate, 0, true); using (var app = new VisualStudioApp()) { try { var project = app.OpenProject(@"TestData\HelloWorld.sln"); string subDir = Guid.NewGuid().ToString(); project.Properties.Item("PublishUrl").Value = Path.Combine(TestSharePrivate, subDir); app.OnDispose(() => project.Properties.Item("PublishUrl").Value = ""); app.OpenSolutionExplorer().SelectProject(project); using (var creds = CredentialsDialog.PublishSelection(app)) { creds.UserName = PrivateShareUserWithoutMachine; creds.Password = PrivateSharePassword; creds.OK(); } System.Threading.Thread.Sleep(2000); using (var helper = new NetUseHelper()) { string dir = Path.Combine(helper.Drive + "\\", subDir); var files = WaitForFiles(dir); Assert.AreEqual(1, files.Length); Assert.AreEqual("Program.py", Path.GetFileName(files[0])); Directory.Delete(dir, true); } } finally { WNetCancelConnection2(TestSharePrivate, 0, true); } } }
public void TestPublishFilesImpersonateNoMachineName() { WNetCancelConnection2(TestSharePrivate, 0, true); using (var app = new VisualStudioApp()) { try { var project = app.OpenProject(@"TestData\HelloWorld.sln"); string subDir = Guid.NewGuid().ToString(); project.Properties.Item("PublishUrl").Value = Path.Combine(TestSharePrivate, subDir); app.OnDispose(() => project.Properties.Item("PublishUrl").Value = ""); app.OpenSolutionExplorer().SelectProject(project); using (var creds = CredentialsDialog.PublishSelection(app)) { creds.UserName = PrivateShareUserWithoutMachine; creds.Password = PrivateSharePassword; creds.OK(); } System.Threading.Thread.Sleep(2000); using (var helper = new NetUseHelper()) { string dir = Path.Combine(helper.Drive + "\\", subDir); var files = WaitForFiles(dir); Assert.AreEqual(1, files.Length); Assert.AreEqual("Program.py", Path.GetFileName(files[0])); Directory.Delete(dir, true); } } finally { WNetCancelConnection2(TestSharePrivate, 0, true); } } }