本文整理汇总了C#中Microsoft.VsSDK.IntegrationTestLibrary.TestUtils.CloseCurrentSolution方法的典型用法代码示例。如果您正苦于以下问题:C# TestUtils.CloseCurrentSolution方法的具体用法?C# TestUtils.CloseCurrentSolution怎么用?C# TestUtils.CloseCurrentSolution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VsSDK.IntegrationTestLibrary.TestUtils
的用法示例。
在下文中一共展示了TestUtils.CloseCurrentSolution方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEmptySolution
public void CreateEmptySolution()
{
var testUtils = new TestUtils();
testUtils.CloseCurrentSolution(
__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave );
testUtils.CreateEmptySolution( TestContext.TestDir, "EmptySolution" );
}
示例2: CreateEmptySolution
public void CreateEmptySolution() {
UIThreadInvoker.Invoke((ThreadInvoker) delegate() {
var testUtils = new TestUtils();
testUtils.CloseCurrentSolution(__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave);
testUtils.CreateEmptySolution(TestContext.TestDir, "EmptySolution");
});
}
示例3: ValidateNewFileOpenedWithEditor
public void ValidateNewFileOpenedWithEditor()
{
UIThreadInvoker.Invoke((ThreadInvoker)delegate()
{
TestUtils testUtils = new TestUtils();
testUtils.CloseCurrentSolution(__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave);
testUtils.CreateEmptySolution(TestContext.TestDir, "CreateEmptySolution");
//Add new file to the solution and save all
string name = "mynewfile";
EnvDTE.DTE dte = VsIdeTestHostContext.Dte;
EnvDTE.Window win = dte.ItemOperations.NewFile(@"Racket Files\Racket", name, EnvDTE.Constants.vsViewKindPrimary);
Assert.IsNotNull(win);
dte.ExecuteCommand("File.SaveAll", string.Empty);
//get the currect misc files state
object OriginalValueMiscFilesSavesLastNItems = dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value;
if ((int)OriginalValueMiscFilesSavesLastNItems == 0)
{
dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value = 5;
}
//get a handle to the project item in the solution explorer
EnvDTE.ProjectItem item = win.Document.ProjectItem;
Assert.IsNotNull(item);
//close window
win.Close(EnvDTE.vsSaveChanges.vsSaveChangesNo);
//reset the miscfiles property if it was modified
if (OriginalValueMiscFilesSavesLastNItems != dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value)
{
dte.get_Properties("Environment", "Documents").Item("MiscFilesProjectSavesLastNItems").Value = OriginalValueMiscFilesSavesLastNItems;
}
});
}