Here are the examples of the csharp api double.ToString() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1411 Examples
19
Source : WindowsMachineInfo.cs
with MIT License
from aprilyush
with MIT License
from aprilyush
public string GetCPURate()
{
//string output = ShellHelper.Cmd("wmic", "cpu get LoadPercentage");
//string cpuRate = output.Replace("LoadPercentage", string.Empty).Trim();
try
{
//ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_PerfFormattedData_PerfOS_Processor");
//var cpuTimes = searcher.Get()
// .Cast<ManagementObject>()
// .Select(mo => new
// {
// Name = mo["Name"],
// Usage = mo["PercentProcessorTime"]
// }).ToList();
//var query = cpuTimes.Where(x => x.Name.ToString() == "_Total").Select(x => x.Usage);
//var cpuUsage = query.SingleOrDefault();
//if (cpuUsage == null)
//{
// return "0";
//}
//return cpuUsage.ToString() + "%";
var startTime = DateTime.UtcNow;
var startCpuUsage = Process.GetCurrentProcess().TotalProcessorTime;
var stopWatch = new Stopwatch();
// Start watching CPU
stopWatch.Start();
// Meansure something else, such as .Net Core Middleware
Thread.Sleep(100);
// Stop watching to meansure
stopWatch.Stop();
var endTime = DateTime.UtcNow;
var endCpuUsage = Process.GetCurrentProcess().TotalProcessorTime;
var cpuUsedMs = (endCpuUsage - startCpuUsage).TotalMilliseconds;
var totalMsPreplaceded = (endTime - startTime).TotalMilliseconds;
var cpuUsageTotal = cpuUsedMs / (Environment.ProcessorCount * totalMsPreplaceded);
var cpuUsagePercentage = cpuUsageTotal * 100;
return cpuUsagePercentage.ToString();
}
catch(Exception ex)
{
LoggerHelper.Exception(ex);
}
return "";
}
19
Source : Zone.cs
with GNU General Public License v3.0
from architecture-building-systems
with GNU General Public License v3.0
from architecture-building-systems
private static bool CheckWindowsOnZone(rg.Brep brep, rg.BrepFace[] windows, double tolerance)
{
int roundingDecimals = tolerance.ToString().Split('.')[1].Length;
// check for Windows on Zone
bool[] equalAreas = new bool[windows.Length];
for (int i = 0; i < windows.Length; i++)
{
rg.BrepFace srf = windows[i];
rg.Brep srfbrep = rg.Brep.CreateTrimmedSurface(srf, srf.UnderlyingSurface(), tolerance);
rg.Curve[] intersectionCrvs;
rg.Point3d[] intersectionPts;
//rg.Intersect.Intersection.BrepSurface(brep, srf, tolerance, out intersectionCrvs, out intersectionPts);
rg.Intersect.Intersection.BrepBrep(brep, srfbrep, tolerance, out intersectionCrvs, out intersectionPts);
if (intersectionCrvs.Length == 0)
return false;
rg.Curve curve = intersectionCrvs[0];
if (intersectionCrvs.Length > 1)
{
rg.Curve[] crv = rg.Curve.JoinCurves(intersectionCrvs);
if (crv.Length > 1 && !crv[0].IsClosed)
return false;
else
curve = crv[0];
}
rg.AreaMreplacedProperties amp = rg.AreaMreplacedProperties.Compute(curve);
if(amp == null)
return false;
double curveArea = amp.Area;
double srfArea = rg.AreaMreplacedProperties.Compute(srf).Area;
if (Math.Round(curveArea, roundingDecimals) != Math.Round(srfArea, roundingDecimals))
return false;
else
equalAreas[i] = true;
}
foreach (bool equalArea in equalAreas)
if (!equalArea)
return false;
return true;
}
19
Source : Zone.cs
with GNU General Public License v3.0
from architecture-building-systems
with GNU General Public License v3.0
from architecture-building-systems
private static bool CheckWindowOnZone(rg.Brep brep, rg.BrepFace window, double tolerance)
{
int roundingDecimals = tolerance.ToString().Split('.')[1].Length;
// check for Windows on Zone
bool equalArea = false;
rg.BrepFace srf = window;
rg.Brep srfbrep = rg.Brep.CreateTrimmedSurface(srf, srf.UnderlyingSurface(), tolerance);
rg.Curve[] intersectionCrvs;
rg.Point3d[] intersectionPts;
//rg.Intersect.Intersection.BrepSurface(brep, srf, tolerance, out intersectionCrvs, out intersectionPts);
rg.Intersect.Intersection.BrepBrep(brep, srfbrep, tolerance, out intersectionCrvs, out intersectionPts);
if (intersectionCrvs.Length == 0)
return false;
rg.Curve curve = intersectionCrvs[0];
if (intersectionCrvs.Length > 1)
{
rg.Curve[] crv = rg.Curve.JoinCurves(intersectionCrvs);
if (crv.Length > 1 && !crv[0].IsClosed)
return false;
else
curve = crv[0];
}
double curveArea, srfArea;
rg.AreaMreplacedProperties amp = rg.AreaMreplacedProperties.Compute(curve);
if (amp == null)
return false;
curveArea = rg.AreaMreplacedProperties.Compute(curve).Area;
srfArea = rg.AreaMreplacedProperties.Compute(srf).Area;
if (Math.Round(curveArea, roundingDecimals) != Math.Round(srfArea, roundingDecimals))
return false;
else
equalArea = true;
if (!equalArea)
return false;
return true;
}
19
Source : NoiseTool.cs
with MIT License
from Arghonot
with MIT License
from Arghonot
void InitializeUI()
{
Input_Frequency.text = frequency.ToString();
Input_Lacunarity.text = lacunarity.ToString();
Input_Persistence.text = persistence.ToString();
Input_Displacement.text = displacement.ToString();
Input_Octave.text = octaves.ToString();
Input_Seed.text = seed.ToString();
Input_Width.text = Width.ToString();
Input_Height.text = Height.ToString();
}
19
Source : Set_up_age_distributions.cs
with GNU Affero General Public License v3.0
from arklumpus
with GNU Affero General Public License v3.0
from arklumpus
public static void Transform(ref TreeNode tree, Dictionary<string, object> parameterValues, Action<double> progressAction)
{
bool fromLeft = (int)parameterValues["Age type:"] == 1;
double threshold = (double)parameterValues["Threshold:"];
int ciType = (int)parameterValues["Credible interval:"];
bool computeMean = (bool)parameterValues["Compute mean"];
TreeCollection treeCollection = (TreeCollection)parameterValues["Trees"];
InstanceStateData stateData = (InstanceStateData)parameterValues["StateData"];
List<TreeNode> nodes = tree.GetChildrenRecursive();
Dictionary<string, List<double>> ageSamples = new Dictionary<string, List<double>>();
for (int i = 0; i < nodes.Count; i++)
{
ageSamples.Add(nodes[i].Id, new List<double>());
}
int sampleIndex = 0;
TreeNode treeClone = tree;
object progressLock = new object();
object addLock = new object();
System.Threading.Tasks.Parallel.ForEach(treeCollection, new ParallelOptions() { MaxDegreeOfParallelism = 6 }, sampledTree =>
{
double treeHeight = -1;
if (!fromLeft)
{
treeHeight = sampledTree.LongestDownstreamLength();
}
foreach (TreeNode node in sampledTree.GetChildrenRecursiveLazy())
{
TreeNode LCA = treeClone.GetLastCommonAncestor(node.GetLeafNames());
if (Compare(LCA.GetLeafNames(), node.GetLeafNames()))
{
double age = node.UpstreamLength();
if (!fromLeft)
{
age = treeHeight - age;
}
lock (addLock)
{
ageSamples[LCA.Id].Add(age);
}
}
}
lock (progressLock)
{
sampleIndex++;
progressAction((double)sampleIndex / treeCollection.Count);
}
});
if (ciType > 0 || computeMean)
{
for (int i = 0; i < nodes.Count; i++)
{
if (ageSamples[nodes[i].Id].Count > 0)
{
if (computeMean)
{
nodes[i].Attributes["Mean age"] = ageSamples[nodes[i].Id].Average();
}
if (ciType == 1)
{
double[] hdi = BayesStats.HighestDensityInterval(ageSamples[nodes[i].Id], threshold);
nodes[i].Attributes[threshold.ToString("0%") + "_HDI"] = "[ " + hdi[0].ToString() + ", " + hdi[1].ToString() + "]";
}
else if (ciType == 2)
{
double[] eti = BayesStats.EqualTailedInterval(ageSamples[nodes[i].Id], threshold);
nodes[i].Attributes[threshold.ToString("0%") + "_ETI"] = "[ " + eti[0].ToString() + ", " + eti[1].ToString() + "]";
}
}
}
}
stateData.Tags["a1ccf05a-cf3c-4ca4-83be-af56f501c2a6"] = ageSamples;
tree.Attributes["a1ccf05a-cf3c-4ca4-83be-af56f501c2a6"] = "Age distributions";
}
19
Source : Set_up_age_distributions_attachment.cs
with GNU Affero General Public License v3.0
from arklumpus
with GNU Affero General Public License v3.0
from arklumpus
public static void Transform(ref TreeNode tree, Dictionary<string, object> parameterValues, Action<double> progressAction)
{
bool fromLeft = (int)parameterValues["Age type:"] == 1;
double threshold = (double)parameterValues["Threshold:"];
int ciType = (int)parameterValues["Credible interval:"];
bool computeMean = (bool)parameterValues["Compute mean"];
InstanceStateData stateData = (InstanceStateData)parameterValues["StateData"];
Attachment attachment = (Attachment)parameterValues["Attachment:"];
if (attachment != null)
{
List<TreeNode> nodes = tree.GetChildrenRecursive();
Dictionary<string, List<double>> ageSamples = new Dictionary<string, List<double>>();
for (int i = 0; i < nodes.Count; i++)
{
ageSamples.Add(nodes[i].Id, new List<double>());
}
attachment.Stream.Seek(attachment.StreamStart, System.IO.SeekOrigin.Begin);
foreach (TreeNode sampledTree in ReadTree.Read(attachment.Stream, progressAction))
{
double treeHeight = -1;
if (!fromLeft)
{
treeHeight = sampledTree.LongestDownstreamLength();
}
foreach (TreeNode node in sampledTree.GetChildrenRecursiveLazy())
{
TreeNode LCA = tree.GetLastCommonAncestor(node.GetLeafNames());
if (Compare(LCA.GetLeafNames(), node.GetLeafNames()))
{
double age = node.UpstreamLength();
if (!fromLeft)
{
age = treeHeight - age;
}
ageSamples[LCA.Id].Add(age);
}
}
}
if (ciType > 0 || computeMean)
{
for (int i = 0; i < nodes.Count; i++)
{
if (ageSamples[nodes[i].Id].Count > 0)
{
if (computeMean)
{
nodes[i].Attributes["Mean age"] = ageSamples[nodes[i].Id].Average();
}
if (ciType == 1)
{
double[] hdi = BayesStats.HighestDensityInterval(ageSamples[nodes[i].Id], threshold);
nodes[i].Attributes[threshold.ToString("0%") + "_HDI"] = "[ " + hdi[0].ToString() + ", " + hdi[1].ToString() + "]";
}
else if (ciType == 2)
{
double[] eti = BayesStats.EqualTailedInterval(ageSamples[nodes[i].Id], threshold);
nodes[i].Attributes[threshold.ToString("0%") + "_ETI"] = "[ " + eti[0].ToString() + ", " + eti[1].ToString() + "]";
}
}
}
}
stateData.Tags["a1ccf05a-cf3c-4ca4-83be-af56f501c2a6"] = ageSamples;
tree.Attributes["a1ccf05a-cf3c-4ca4-83be-af56f501c2a6"] = "Age distributions";
}
}
19
Source : Primitives.cs
with GNU General Public License v3.0
from arklumpus
with GNU General Public License v3.0
from arklumpus
public override string ToString()
{
return this.X.ToString() + "; " + this.Y.ToString() + "; " + this.Z.ToString();
}
19
Source : DefaultWrappers.cs
with MIT License
from asc-community
with MIT License
from asc-community
public string ToString(double a) => a.ToString();
19
Source : GetDimensions.cs
with MIT License
from aspose-pdf
with MIT License
from aspose-pdf
public static void Run()
{
// ExStart:GetDimensions
// The path to the doreplacedents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Pages();
// Open doreplacedent
Doreplacedent pdfDoreplacedent = new Doreplacedent(dataDir + "UpdateDimensions.pdf");
// Adds a blank page to pdf doreplacedent
Page page = pdfDoreplacedent.Pages.Count > 0 ? pdfDoreplacedent.Pages[1] : pdfDoreplacedent.Pages.Add();
// Get page height and width information
Console.WriteLine(page.GetPageRect(true).Width.ToString() + ":" + page.GetPageRect(true).Height);
// Rotate page at 90 degree angle
page.Rotate = Rotation.on90;
// Get page height and width information
Console.WriteLine(page.GetPageRect(true).Width.ToString() + ":" + page.GetPageRect(true).Height);
// ExEnd:GetDimensions
}
19
Source : DetermineTableBreak.cs
with MIT License
from aspose-pdf
with MIT License
from aspose-pdf
public static void Run()
{
// ExStart:DetermineTableBreak
// The path to the doreplacedents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Tables();
// Instantiate an object PDF clreplaced
Doreplacedent pdf = new Doreplacedent();
// Add the section to PDF doreplacedent sections collection
Aspose.Pdf.Page page = pdf.Pages.Add();
// Instantiate a table object
Aspose.Pdf.Table table1 = new Aspose.Pdf.Table();
table1.Margin.Top = 300;
// Add the table in paragraphs collection of the desired section
page.Paragraphs.Add(table1);
// Set with column widths of the table
table1.ColumnWidths = "100 100 100";
// Set default cell border using BorderInfo object
table1.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.1F);
// Set table border using another customized BorderInfo object
table1.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1F);
// Create MarginInfo object and set its left, bottom, right and top margins
Aspose.Pdf.MarginInfo margin = new Aspose.Pdf.MarginInfo();
margin.Top = 5f;
margin.Left = 5f;
margin.Right = 5f;
margin.Bottom = 5f;
// Set the default cell padding to the MarginInfo object
table1.DefaultCellPadding = margin;
// If you increase the counter to 17, table will break
// Because it cannot be accommodated any more over this page
for (int RowCounter = 0; RowCounter <= 16; RowCounter++)
{
// Create rows in the table and then cells in the rows
Aspose.Pdf.Row row1 = table1.Rows.Add();
row1.Cells.Add("col " + RowCounter.ToString() + ", 1");
row1.Cells.Add("col " + RowCounter.ToString() + ", 2");
row1.Cells.Add("col " + RowCounter.ToString() + ", 3");
}
// Get the Page Height information
float PageHeight = (float)pdf.PageInfo.Height;
// Get the total height information of Page Top & Bottom margin,
// Table Top margin and table height.
float TotalObjectsHeight = (float)page.PageInfo.Margin.Top + (float)page.PageInfo.Margin.Bottom + (float)table1.Margin.Top + (float)table1.GetHeight();
// Display Page Height, Table Height, table Top margin and Page Top
// And Bottom margin information
Console.WriteLine("PDF doreplacedent Height = " + pdf.PageInfo.Height.ToString() + "\nTop Margin Info = " + page.PageInfo.Margin.Top.ToString() + "\nBottom Margin Info = " + page.PageInfo.Margin.Bottom.ToString() + "\n\nTable-Top Margin Info = " + table1.Margin.Top.ToString() + "\nAverage Row Height = " + table1.Rows[0].MinRowHeight.ToString() + " \nTable height " + table1.GetHeight().ToString() + "\n ----------------------------------------" + "\nTotal Page Height =" + PageHeight.ToString() + "\nreplacedmulative height including Table =" + TotalObjectsHeight.ToString());
// Check if we deduct the sume of Page top margin + Page Bottom margin
// + Table Top margin and table height from Page height and its less
// Than 10 (an average row can be greater than 10)
if ((PageHeight - TotalObjectsHeight) <= 10)
// If the value is less than 10, then display the message.
// Which shows that another row can not be placed and if we add new
// Row, table will break. It depends upon the row height value.
Console.WriteLine("Page Height - Objects Height < 10, so table will break");
dataDir = dataDir + "DetermineTableBreak_out.pdf";
// Save the pdf doreplacedent
pdf.Save(dataDir);
// ExEnd:DetermineTableBreak
Console.WriteLine("\nTable break determined successfully.\nFile saved at " + dataDir);
}
19
Source : ExtensionsUtil.cs
with GNU General Public License v3.0
from astand
with GNU General Public License v3.0
from astand
public static string ToViewable(this double x)
{
var ret = "";
if (x - Math.Truncate(x) == 0)
{
ret = x.ToString("F0");
}
else
{
ret = x.ToString();
}
return ret;
}
19
Source : Form1.cs
with Apache License 2.0
from atasoyhus
with Apache License 2.0
from atasoyhus
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog opf = new OpenFileDialog();
opf.Filter = "Image files|*.bmp;*.jpeg;*.jpg;*.png";
if (opf.ShowDialog() != DialogResult.OK) return;
Bitmap b = new Bitmap(opf.FileName);
cnn.inputLayer.setInput(b, Input.ResizingMethod.ZeroPad);
pictureBox1.Image = (Image)cnn.inputLayer.ResizedInputBmp.Clone();
tic();
Layer currentLayer = cnn.inputLayer;
int i = 0;
while (currentLayer.nextLayer != null)
{
if (i == 0)
prependLine("Loading bitmap data...");
else
prependLine("Layer " + i + " (" + currentLayer.type + ") ...");
Application.DoEvents();
currentLayer.feedNext();
currentLayer = currentLayer.nextLayer;
i += 1;
}
Output outputLayer = (Output)currentLayer;
prependLine("Finished in " + toc().ToString() + " seconds");
string decision = outputLayer.getDecision();
string hLine = new string('-', 100);
prependLine(hLine, "");
for (i = 2; i >= 0; i--)
prependLine(" #" + (i + 1) + " " + outputLayer.sortedClreplacedes[i] + " (" + Math.Round(outputLayer.probabilities[i], 3) + ")", "");
prependLine(hLine, "");
prependLine("THE HIGHEST 3 PROBABILITIES: ", "");
prependLine(hLine, "");
prependLine("DECISION: " + decision);
prependLine(hLine, "");
}
19
Source : FFmpeg.cs
with GNU General Public License v3.0
from audiamus
with GNU General Public License v3.0
from audiamus
private string getVariableBitrateAac (uint cbr) {
double vbr = Math.Round (cbr / 100.0, 1);
vbr = vbr.MinMax (0.1, 2);
Log (3, this, () => $"{ID}cbr {cbr} kb/s -> vbr {vbr}");
return vbr.ToString ();
}
19
Source : ConsoleImpl.cs
with BSD 3-Clause "New" or "Revised" License
from aura-systems
with BSD 3-Clause "New" or "Revised" License
from aura-systems
public static void Write(double aDouble) => Write(aDouble.ToString());
19
Source : ConsoleImpl.cs
with BSD 3-Clause "New" or "Revised" License
from aura-systems
with BSD 3-Clause "New" or "Revised" License
from aura-systems
public static void WriteLine(double aDouble) => WriteLine(aDouble.ToString());
19
Source : Radian.Test.cs
with MIT License
from Autodesk
with MIT License
from Autodesk
[Test]
public void ToStringTest()
{
Radian angle = new Radian(1.23);
replacedert.AreEqual(angle.ToString(), 1.23.ToString());
replacedert.AreEqual(angle.ToString("N3"), 1.23.ToString("N3"));
System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.CreateSpecificCulture("de-DE");
replacedert.AreEqual(angle.ToString(culture), 1.23.ToString(culture));
replacedert.AreEqual(angle.ToString("N3", culture), 1.23.ToString("N3", culture));
}
19
Source : Degree.Test.cs
with MIT License
from Autodesk
with MIT License
from Autodesk
[Test]
public void ToStringTest()
{
Degree angle = new Degree(1.23);
replacedert.AreEqual(angle.ToString(), 1.23.ToString());
replacedert.AreEqual(angle.ToString("N3"), 1.23.ToString("N3"));
System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.CreateSpecificCulture("de-DE");
replacedert.AreEqual(angle.ToString(culture), 1.23.ToString(culture));
replacedert.AreEqual(angle.ToString("N3", culture), 1.23.ToString("N3", culture));
}
19
Source : Number.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public virtual void SetNumber(double value)
{
DefaultSetText(SettingNumber, NumberSet, value.ToString());
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertFirstMeaningfulPaintScoreMoreThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.FirstMeaningfulPaint.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue > expected, $"{PerformanceReport.Value.Audits.FirstMeaningfulPaint.replacedle} should be > {expected} but was {actualValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.FirstMeaningfulPaint.Score.ToString(), PerformanceReport.Value.Audits.FirstMeaningfulPaint.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertFirstContentfulPaintScoreLessThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.FirstContentfulPaint.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.FirstContentfulPaint.replacedle} should be < {expected} but was {actualValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.FirstContentfulPaint.Score.ToString(), PerformanceReport.Value.Audits.FirstContentfulPaint.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertSpeedIndexScoreLessThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.SpeedIndex.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.SpeedIndex.replacedle} should be < {expected} but was {actualValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.SpeedIndex.Score.ToString(), PerformanceReport.Value.Audits.SpeedIndex.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertLargestContentfulPaintScoreLessThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.LargestContentfulPaint.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.LargestContentfulPaint.replacedle} should be < {expected} but was {actualValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.LargestContentfulPaint.Score.ToString(), PerformanceReport.Value.Audits.LargestContentfulPaint.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertInteractiveScoreLessThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.Interactive.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.Interactive.replacedle} should be < {expected} but was {actualValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.Interactive.Score.ToString(), PerformanceReport.Value.Audits.Interactive.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertTotalBlockingTimeLessThan(double expected)
{
double actualValue = double.Parse(PerformanceReport.Value.Audits.TotalBlockingTime.DisplayValue);
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.TotalBlockingTime.replacedle} should be < {expected} but was {actualValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.TotalBlockingTime.DisplayValue, PerformanceReport.Value.Audits.TotalBlockingTime.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertreplacedulativeLayoutShiftScoreLessThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.replacedulativeLayoutShift.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.replacedulativeLayoutShift.replacedle} should be < {expected} but was {actualValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.replacedulativeLayoutShift.Score.ToString(), PerformanceReport.Value.Audits.replacedulativeLayoutShift.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertRedirectScoreAboveThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.Redirects.NumericValue;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.Redirects.replacedle} should be > {expected} but was {PerformanceReport.Value.Audits.Redirects.NumericValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.Redirects.Score.ToString(), PerformanceReport.Value.Audits.Redirects.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacederJavaExecutionTimeScoreAboveThan(double expected)
{
double actualValue = PerformanceReport.Value.Audits.BootupTime.NumericValue;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue < expected, $"{PerformanceReport.Value.Audits.BootupTime.replacedle} should be > {expected} but was {PerformanceReport.Value.Audits.BootupTime.NumericValue}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Audits.BootupTime.Score.ToString(), PerformanceReport.Value.Audits.BootupTime.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacederSEOScoreAboveThan(double expected)
{
double actualValue = PerformanceReport.Value.Categories.Seo.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue > expected, $"{PerformanceReport.Value.Categories.Seo.replacedle} should be > {expected} but was {PerformanceReport.Value.Categories.Seo.Score}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Categories.Seo.Score.ToString(), PerformanceReport.Value.Categories.Seo.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacederBestPracticesScoreAboveThan(double expected)
{
double actualValue = PerformanceReport.Value.Categories.BestPractices.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue > expected, $"{PerformanceReport.Value.Categories.BestPractices.replacedle} should be > {expected} but was {PerformanceReport.Value.Categories.BestPractices.Score}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Categories.BestPractices.Score.ToString(), PerformanceReport.Value.Categories.BestPractices.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertPWAScoreAboveThan(double expected)
{
double actualValue = PerformanceReport.Value.Categories.Pwa.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue > expected, $"{PerformanceReport.Value.Categories.Pwa.replacedle} should be > {expected} but was {PerformanceReport.Value.Categories.Pwa.Score}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Categories.Pwa.Score.ToString(), PerformanceReport.Value.Categories.Pwa.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertAccessibilityScoreAboveThan(double expected)
{
double actualValue = PerformanceReport.Value.Categories.Accessibility.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue > expected, $"{PerformanceReport.Value.Categories.Accessibility.replacedle} should be > {expected} but was {PerformanceReport.Value.Categories.Accessibility.Score}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Categories.Accessibility.Score.ToString(), PerformanceReport.Value.Categories.Accessibility.replacedle));
}
19
Source : LighthouseService.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public void replacedertPerformanceScoreAboveThan(double expected)
{
double actualValue = PerformanceReport.Value.Categories.Performance.Score;
replacedert.IsTrue<LighthousereplacedertFailedException>(actualValue > expected, $"{PerformanceReport.Value.Categories.Performance.replacedle} should be > {expected} but was {PerformanceReport.Value.Categories.Performance.Score}");
replacedertedLighthouseReportEvent?.Invoke(this, new LighthouseReportEventArgs(expected.ToString(), PerformanceReport.Value.Categories.Performance.Score.ToString(), PerformanceReport.Value.Categories.Performance.replacedle));
}
19
Source : ValidateControlExtensions.GetNumber.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void ValidateNumberIs<T>(this T control, double value, int? timeout = null, int? sleepInterval = null)
where T : IComponentNumber, IComponent
{
WaitUntil(() => control.GetNumber().Equals(value), $"The control's number should be '{value}' but was '{control.GetNumber()}'.", timeout, sleepInterval);
ValidatedNumberIsEvent?.Invoke(control, new ComponentActionEventArgs(control, value.ToString()));
}
19
Source : AssertionsExtensions.Height.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertHeight(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.AreEqual<LayoutreplacedertFailedException, double>(layoutComponent.Size.Height, expected, $"The height of {layoutComponent.ComponentName} was not {expected} px, but {layoutComponent.Size.Height} px.");
replacedertedHeightEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Height.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertHeightBetween(this ILayoutComponent layoutComponent, double from, double to)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Height >= from && layoutComponent.Size.Height <= to, $"The height of {layoutComponent.ComponentName} was not between {from} and {to} px, but {layoutComponent.Size.Height} px.");
replacedertedHeightBetweenEvent?.Invoke(layoutComponent, new LayoutComponentTwoValuesActionEventArgs(layoutComponent, from.ToString(), to.ToString()));
}
19
Source : AssertionsExtensions.Height.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertHeightGreaterThan(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Height > expected, $"The height of {layoutComponent.ComponentName} was not > {expected} px, but {layoutComponent.Size.Height} px.");
replacedertedHeightGreaterThanEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Height.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertHeightGreaterThanOrEqual(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Height >= expected, $"The height of {layoutComponent.ComponentName} was not >= {expected} px, but {layoutComponent.Size.Height} px.");
replacedertedHeightGreaterThanOrEqualEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Height.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertHeightLessThan(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Height < expected, $"The height of {layoutComponent.ComponentName} was not < {expected} px, but {layoutComponent.Size.Height} px.");
replacedertedHeightLessThanEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Height.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertHeightLessThanOrEqual(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Height <= expected, $"The height of {layoutComponent.ComponentName} was not <= {expected} px, but {layoutComponent.Size.Height} px.");
replacedertedHeightLessThanOrEqualEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Height.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertHeightApproximate(this ILayoutComponent layoutComponent, ILayoutComponent secondElement, double expectedPercentDifference)
{
var actualPercentDifference = CalculatePercentDifference(layoutComponent.Size.Height, secondElement.Size.Height);
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(actualPercentDifference <= expectedPercentDifference, $"The height % difference between {layoutComponent.ComponentName} and {secondElement.ComponentName} was greater than {expectedPercentDifference}%, it was {actualPercentDifference} px.");
replacedertedHeightApproximateSecondElementEvent?.Invoke(layoutComponent, new LayoutTwoComponentsActionEventArgs(layoutComponent, secondElement, expectedPercentDifference.ToString()));
}
19
Source : AssertionsExtensions.Width.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertWidth(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.AreEqual<LayoutreplacedertFailedException, double>(layoutComponent.Size.Width, expected, $"The width of {layoutComponent.ComponentName} was not {expected} px, but {layoutComponent.Size.Width} px.");
replacedertedWidthEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Width.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertWidthBetween(this ILayoutComponent layoutComponent, double from, double to)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Width >= from && layoutComponent.Size.Width <= to, $"The width of {layoutComponent.ComponentName} was not between {from} and {to} px, but {layoutComponent.Size.Width} px.");
replacedertedWidthBetweenEvent?.Invoke(layoutComponent, new LayoutComponentTwoValuesActionEventArgs(layoutComponent, from.ToString(), to.ToString()));
}
19
Source : AssertionsExtensions.Width.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertWidthGreaterThan(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Width > expected, $"The width of {layoutComponent.ComponentName} was not > {expected} px, but {layoutComponent.Size.Width} px.");
replacedertedWidthGreaterThanEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Width.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertWidthGreaterThanOrEqual(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Width >= expected, $"The width of {layoutComponent.ComponentName} was not >= {expected} px, but {layoutComponent.Size.Width} px.");
replacedertedWidthGreaterThanOrEqualEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Width.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertWidthLessThan(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Width < expected, $"The width of {layoutComponent.ComponentName} was not < {expected} px, but {layoutComponent.Size.Width} px.");
replacedertedWidthLessThanEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Width.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertWidthLessThanOrEqual(this ILayoutComponent layoutComponent, double expected)
{
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(layoutComponent.Size.Width <= expected, $"The width of {layoutComponent.ComponentName} was not <= {expected} px, but {layoutComponent.Size.Width} px.");
replacedertedWidthLessThanOrEqualEvent?.Invoke(layoutComponent, new LayoutComponentActionEventArgs(layoutComponent, expected.ToString()));
}
19
Source : AssertionsExtensions.Width.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public static void replacedertWidthApproximate(this ILayoutComponent layoutComponent, ILayoutComponent secondElement, double expectedPercentDifference)
{
var actualPercentDifference = CalculatePercentDifference(layoutComponent.Size.Width, secondElement.Size.Width);
BA.replacedert.IsTrue<LayoutreplacedertFailedException>(actualPercentDifference <= expectedPercentDifference, $"The width % difference between {layoutComponent.ComponentName} and {secondElement.ComponentName} was greater than {expectedPercentDifference}%, it was {actualPercentDifference} px.");
replacedertedWidthApproximateSecondElementEvent?.Invoke(layoutComponent, new LayoutTwoComponentsActionEventArgs(layoutComponent, secondElement, expectedPercentDifference.ToString()));
}
19
Source : SeekBar.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public virtual void Set(double percentage)
{
SettingPercentage?.Invoke(this, new ComponentActionEventArgs<AndroidElement>(this, percentage.ToString()));
int end = WrappedElement.Size.Width;
int y = WrappedElement.Location.Y;
var touchActionsService = ServicesCollection.Current.Resolve<TouchActionsService<AndroidDriver<AndroidElement>, AndroidElement>>();
int moveTo = (int)((percentage / 100) * end);
touchActionsService.Press(moveTo, y, 0).Release().Perform();
PercentageSet?.Invoke(this, new ComponentActionEventArgs<AndroidElement>(this, percentage.ToString()));
}
19
Source : SeekBar.cs
with Apache License 2.0
from AutomateThePlanet
with Apache License 2.0
from AutomateThePlanet
public virtual void Set(double value)
{
SettingPercentage?.Invoke(this, new ComponentActionEventArgs<IOSElement>(this, value.ToString()));
int end = WrappedElement.Size.Width;
int y = WrappedElement.Location.Y;
var touchActionsService = ServicesCollection.Current.Resolve<TouchActionsService<IOSDriver<IOSElement>, IOSElement>>();
int moveTo = (int)((value / 100) * end);
touchActionsService.Press(moveTo, y, 0).Release().Perform();
PercentageSet?.Invoke(this, new ComponentActionEventArgs<IOSElement>(this, value.ToString()));
}
19
Source : InteractionMethodArgumentSetBuilder.cs
with MIT License
from autostep
with MIT License
from autostep
public InteractionMethodArgumentSetBuilder Float(double value, int startColumn)
{
Built.Arguments.Add(new FloatMethodArgumentElement(value)
{
SourceLine = Built.SourceLine,
StartColumn = startColumn,
EndLine = Built.SourceLine,
EndColumn = startColumn + value.ToString().Length - 1,
});
return this;
}
See More Examples