mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 05:43:10 -07:00
debug
This commit is contained in:
parent
7e4938e5be
commit
a4b09e02dd
1 changed files with 22 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using CalculatorUITestFramework;
|
using CalculatorUITestFramework;
|
||||||
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
@ -43,6 +45,7 @@ namespace CalculatorUITests
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void TestInit()
|
public void TestInit()
|
||||||
{
|
{
|
||||||
|
VerifyConnection();
|
||||||
CalculatorApp.EnsureCalculatorHasFocus();
|
CalculatorApp.EnsureCalculatorHasFocus();
|
||||||
page.EnsureCalculatorIsCurrencyMode();
|
page.EnsureCalculatorIsCurrencyMode();
|
||||||
page.EnsureCalculatorResultTextIsZero();
|
page.EnsureCalculatorResultTextIsZero();
|
||||||
|
@ -55,6 +58,25 @@ namespace CalculatorUITests
|
||||||
page.ClearAll();
|
page.ClearAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void VerifyConnection()
|
||||||
|
{
|
||||||
|
var process = new Process();
|
||||||
|
var startInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
WindowStyle = ProcessWindowStyle.Hidden,
|
||||||
|
FileName = "cmd.exe",
|
||||||
|
Arguments = @"/C curl ""http://localhost/calctesting/file/?id=currency+converter+data&localCurrency=""",
|
||||||
|
RedirectStandardOutput = true, // Redirect the standard output
|
||||||
|
UseShellExecute = false,
|
||||||
|
CreateNoWindow = true
|
||||||
|
};
|
||||||
|
process.StartInfo = startInfo;
|
||||||
|
process.Start();
|
||||||
|
var debug = process.StandardOutput.ReadToEnd();
|
||||||
|
process.WaitForExit();
|
||||||
|
Console.WriteLine($"----------- exitcode: {process.ExitCode}, curl result: {debug}");
|
||||||
|
}
|
||||||
|
|
||||||
private string NormalizeCurrencyText(string realValue, int fractionDigits)
|
private string NormalizeCurrencyText(string realValue, int fractionDigits)
|
||||||
{
|
{
|
||||||
if (!realValue.Contains('.')) return realValue;
|
if (!realValue.Contains('.')) return realValue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue