mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-20 21:33: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.
|
||||
// Licensed under the MIT License.
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using CalculatorUITestFramework;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
@ -43,6 +45,7 @@ namespace CalculatorUITests
|
|||
[TestInitialize]
|
||||
public void TestInit()
|
||||
{
|
||||
VerifyConnection();
|
||||
CalculatorApp.EnsureCalculatorHasFocus();
|
||||
page.EnsureCalculatorIsCurrencyMode();
|
||||
page.EnsureCalculatorResultTextIsZero();
|
||||
|
@ -55,6 +58,25 @@ namespace CalculatorUITests
|
|||
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)
|
||||
{
|
||||
if (!realValue.Contains('.')) return realValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue