本文整理汇总了C#中TestUtilities.UI.Python.PythonVisualStudioApp.WaitForOutputWindowText方法的典型用法代码示例。如果您正苦于以下问题:C# PythonVisualStudioApp.WaitForOutputWindowText方法的具体用法?C# PythonVisualStudioApp.WaitForOutputWindowText怎么用?C# PythonVisualStudioApp.WaitForOutputWindowText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestUtilities.UI.Python.PythonVisualStudioApp
的用法示例。
在下文中一共展示了PythonVisualStudioApp.WaitForOutputWindowText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WebProjectStaticUri
public void WebProjectStaticUri() {
using (var app = new PythonVisualStudioApp()) {
var project = app.CreateProject(
PythonVisualStudioApp.TemplateLanguageName,
PythonVisualStudioApp.EmptyWebProjectTemplate,
TestData.GetTempPath(),
"WebProjectStaticUri"
);
var proj = project.GetCommonProject();
Assert.IsNotNull(proj);
app.ServiceProvider.GetUIThread().Invoke(() => {
proj.SetProjectProperty("PythonWsgiHandler", "NoHandler");
proj.SetProjectProperty("StaticUriPattern", "");
proj.SetProjectProperty("StaticUriRewrite", "");
});
app.ExecuteCommand("Build.RebuildSolution");
app.WaitForOutputWindowText("Build", "1 succeeded");
var webConfig = File.ReadAllText(Path.Combine(Path.GetDirectoryName(project.FullName), "web.config"));
if (!webConfig.Contains(@"<add input=""true"" pattern=""false"" />")) {
Assert.Fail(string.Format("Did not find Static Files condition in:{0}{0}{1}",
Environment.NewLine,
webConfig
));
}
app.ServiceProvider.GetUIThread().Invoke(() => {
proj.SetProjectProperty("StaticUriPattern", "^static/.*$");
});
app.ExecuteCommand("Build.RebuildSolution");
app.WaitForOutputWindowText("Build", "1 succeeded");
webConfig = File.ReadAllText(Path.Combine(Path.GetDirectoryName(project.FullName), "web.config"));
if (!webConfig.Contains(@"<add input=""{REQUEST_URI}"" pattern=""^static/.*$"" ignoreCase=""true"" negate=""true"" />")) {
Assert.Fail(string.Format("Did not find rewrite condition in:{0}{0}{1}",
Environment.NewLine,
webConfig
));
}
if (!webConfig.Contains(@"<add input=""true"" pattern=""false"" />")) {
Assert.Fail(string.Format("Did not find Static Files condition in:{0}{0}{1}",
Environment.NewLine,
webConfig
));
}
app.ServiceProvider.GetUIThread().Invoke(() => {
proj.SetProjectProperty("StaticUriRewrite", "static_files/{R:1}");
});
app.ExecuteCommand("Build.RebuildSolution");
app.WaitForOutputWindowText("Build", "1 succeeded");
webConfig = File.ReadAllText(Path.Combine(Path.GetDirectoryName(project.FullName), "web.config"));
if (webConfig.Contains(@"<add input=""{REQUEST_URI}"" pattern=""^static/.*$"" ignoreCase=""true"" negate=""true"" />")) {
Assert.Fail(string.Format("Found old rewrite condition in:{0}{0}{1}",
Environment.NewLine,
webConfig
));
}
if (!webConfig.Contains(@"<action type=""Rewrite"" url=""static_files/{R:1}"" appendQueryString=""true"" />")) {
Assert.Fail(string.Format("Did not find rewrite action in:{0}{0}{1}",
Environment.NewLine,
webConfig
));
}
if (webConfig.Contains(@"<add input=""true"" pattern=""false"" />")) {
Assert.Fail(string.Format("Should not have found Static Files condition in:{0}{0}{1}",
Environment.NewLine,
webConfig
));
}
app.ServiceProvider.GetUIThread().Invoke(() => {
proj.SetProjectProperty("StaticUriPattern", "invalid[pattern");
});
app.ExecuteCommand("Build.RebuildSolution");
app.WaitForOutputWindowText("Build", "1 failed");
}
}