200 references to InRange
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
82Assert.InRange(new Uri(responseText).Port, _minPort, _maxPort);
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
82Assert.InRange(new Uri(responseText).Port, _minPort, _maxPort);
InMemory.FunctionalTests (5)
BadHttpRequestTests.cs (1)
230Assert.All(TestSink.Writes.Where(w => w.LoggerName != "Microsoft.Hosting.Lifetime"), w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Debug));
ChunkedRequestTests.cs (1)
1072Assert.All(TestSink.Writes, w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Information));
Http2\Http2ConnectionTests.cs (1)
5306Assert.All(LogMessages, w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Debug));
Http3\Http3ConnectionTests.cs (1)
739Assert.InRange(errorCodeFeature.Error, 0, (1L << 62) - 1); // Valid range for HTTP/3 error codes
RequestTests.cs (1)
2030Assert.All(TestSink.Writes, w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Information));
Microsoft.AspNetCore.DataProtection.Extensions.Tests (2)
DataProtectionAdvancedExtensionsTests.cs (2)
53Assert.InRange(actualExpiration, lowerBound, upperBound); 76Assert.InRange(actualExpiration, lowerBound, upperBound);
Microsoft.AspNetCore.DataProtection.Tests (6)
KeyManagement\KeyRingProviderTests.cs (1)
912Assert.InRange(actual, now + TimeSpan.FromHours(24 * 0.8), now + TimeSpan.FromHours(24));
KeyManagement\XmlKeyManagerTests.cs (2)
317Assert.InRange(actualCreationDate.Value, minCreationDate, DateTimeOffset.UtcNow); 744Assert.InRange(actualRevocationDate.Value, minRevocationDate, DateTimeOffset.UtcNow);
Repositories\EphemeralXmlRepositoryTests.cs (1)
80Assert.InRange(elementSet.Count, 0, 2);
Repositories\FileSystemXmlRepositoryTests.cs (1)
185Assert.InRange(elementSet.Count, 0, 2);
Repositories\RegistryXmlRepositoryTests.cs (1)
173Assert.InRange(elementSet.Count, 0, 2);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Latency\ChecpointAcceptanceTests.cs (3)
65Assert.InRange(exitPipelineValue, 0, 10_000); 66Assert.InRange(responseProcessedValue, 0, 10_000); 134Assert.InRange(value, 0, 10_000);
Microsoft.AspNetCore.Http.Extensions.Tests (4)
HttpResponseJsonExtensionsTests.cs (4)
328Assert.InRange(body.ToArray().Length, 0, 1); 362Assert.InRange(body.ToArray().Length, 0, 1); 396Assert.InRange(body.ToArray().Length, 0, 1); 430Assert.InRange(body.ToArray().Length, 0, 1);
Microsoft.AspNetCore.HttpLogging.Tests (6)
W3CLoggerTests.cs (2)
43Assert.InRange(delta, -1, 10); 87Assert.InRange(delta, -1, 10);
W3CLoggingMiddlewareTests.cs (4)
98Assert.InRange(delta, -1, 10); 143Assert.InRange(delta, -1, 10); 263Assert.InRange(delta, -1, 10); 301Assert.InRange(delta, -1, 10);
Microsoft.AspNetCore.Mvc.Core.Test (4)
Formatters\SystemTextJsonOutputFormatterTest.cs (1)
144Assert.InRange(body.ToArray().Length, 0, 1);
Infrastructure\JsonResultExecutorTestBase.cs (3)
379Assert.InRange(written.Length, 0, 1); 413Assert.InRange(written.Length, 0, 2); 463Assert.InRange(written.Length, 0, 2);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (3)
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (3)
379Assert.InRange(written.Length, 0, 1); 413Assert.InRange(written.Length, 0, 2); 463Assert.InRange(written.Length, 0, 2);
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
ValidationSummaryTagHelperTest.cs (1)
254Assert.InRange(output.Attributes.Count, low: 1, high: 2);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (1)
162Assert.InRange(_dynamicTable.MaxSize, 1, _literalHeaderNameBytes.Length); // Assert that our string will be too big
Microsoft.AspNetCore.Shared.Tests (1)
runtime\Http2\HPackDecoderTest.cs (1)
162Assert.InRange(_dynamicTable.MaxSize, 1, _literalHeaderNameBytes.Length); // Assert that our string will be too big
Microsoft.AspNetCore.SignalR.Tests (1)
HubConnectionHandlerTests.cs (1)
2729Assert.InRange(counter, 1, 50);
Microsoft.AspNetCore.WebUtilities.Tests (2)
FileBufferingReadStreamTests.cs (2)
482Assert.InRange(withBufferMs.NumberOfWrites, 1, mostExpectedWrites); 506Assert.InRange(withBufferMs.NumberOfWrites, 1, mostExpectedWrites);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Formatting\Indentation\CSharpFormatterTestsBase.cs (1)
79Assert.InRange(index, 0, int.MaxValue);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\CompilationEmitTests.cs (1)
4221Assert.InRange(reader.GetRowNumber(scope), 1, reader.GetRowNumber(typeRef) - 1);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\OverloadResolutionTests.cs (1)
6834Assert.InRange(elapsed.TotalSeconds, 0, 10.0); // Was originally over 30 minutes, so we have some wiggle room here.
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (16)
Compilation\CompilationAPITests.cs (5)
835Assert.InRange(comp.GetDiagnostics().Count(), 0, int.MaxValue); 836Assert.InRange(comp.GetDeclarationDiagnostics().Count(), 0, int.MaxValue); 889Assert.InRange(comp.GetDiagnostics().Count(), 0, int.MaxValue); 899Assert.InRange(comp.GetDiagnostics().Count(), 0, int.MaxValue); 907Assert.InRange(error.Count(), 1, int.MaxValue);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (4)
4664Assert.InRange(enclosingTypePosition, 0, text.Length); 4666Assert.InRange(declaringTypePosition, 0, text.Length); 4668Assert.InRange(nestedTypePosition, 0, text.Length); 4670Assert.InRange(otherTypePosition, 0, text.Length);
DocumentationComments\CrefTests.cs (1)
6628Assert.InRange(references.Length, 0, 1); //Otherwise, call GetReferencedSymbols
DocumentationComments\DocumentationCommentCompilerTests.cs (1)
7316Assert.InRange(DocumentationCommentIncludeCache.CacheMissCount, 1, 2); //Not none, not all.
SymbolDisplay\SymbolDisplayTests.cs (4)
6966Assert.InRange(EnumField.Comparer.Compare(lhs, rhs), 1, int.MaxValue); 6970Assert.InRange(EnumField.Comparer.Compare(lhs, rhs), 1, int.MaxValue); 6974Assert.InRange(EnumField.Comparer.Compare(lhs, rhs), int.MinValue, -1); 6978Assert.InRange(EnumField.Comparer.Compare(lhs, rhs), 1, int.MaxValue);
Symbols\Metadata\PE\TypeForwarders.cs (1)
1796Assert.InRange(numParts, 1, int.MaxValue);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Diagnostics\DiagnosticTest.cs (1)
149Assert.InRange(actualErrors.Count(), 1, int.MaxValue);
Diagnostics\LocationsTests.cs (3)
400Assert.InRange(diag.Location.SourceSpan.End, diag.Location.SourceSpan.Start, syntaxTree.GetText().Length); 465Assert.InRange(diag.Location.SourceSpan.Start, 0, syntaxTree.GetText().Length); 466Assert.InRange(diag.Location.SourceSpan.End, 0, syntaxTree.GetText().Length);
IncrementalParsing\IncrementalParsingTests.cs (1)
115Assert.InRange(diffs.Length, 0, kinds.Length);
Syntax\SyntaxNodeTests.cs (1)
3586Assert.InRange(0, root.FullSpan.Start, root.FullSpan.End);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
DiagnosticTestUtilities.cs (1)
179Assert.InRange(expectedErrorDesp.Length, 0, actualErrors.Count());
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
ResultProviderTestBase.cs (1)
225Assert.InRange(totalChildCount, 0, int.MaxValue);
Microsoft.CodeAnalysis.UnitTests (8)
Collections\HashSet\SegmentedHashSet_Generic_Tests`1.cs (5)
538Assert.InRange(set.EnsureCapacity(requestedCapacity), requestedCapacity, int.MaxValue); 597Assert.InRange(set.EnsureCapacity(setLength - 1), setLength, int.MaxValue); 612Assert.InRange(newCapacity, currentCapacity * 2, int.MaxValue); 665Assert.InRange(c.EqualsCalls, 1, int.MaxValue); 666Assert.InRange(c.GetHashCodeCalls, 1, int.MaxValue);
Collections\ImmutablesTestBase.cs (1)
173Assert.InRange(length, 0, int.MaxValue);
Collections\List\SegmentedList.Generic.Tests.Sort.cs (2)
139Assert.InRange(comparer.Compare(list[i], list[i + 1]), int.MinValue, 0); 156Assert.InRange(comparer.Compare(list[i], list[i + 1]), int.MinValue, 1);
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
4113Assert.InRange(fileContents.Length, 4, Integer.MaxValue)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
ParserTestUtilities.vb (2)
306Assert.InRange(i, 0, expected.Length - 1) 346Assert.InRange(trivia.Count, 1, 2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
1375Assert.InRange(workspace.Diagnostics.Count, 2, 3); 2522Assert.InRange(project.ProjectReferences.Count(), 0, 1);
Microsoft.DotNet.XUnitAssert.Tests (7)
RangeAssertsTests.cs (7)
17 var ex = Record.Exception(() => Assert.InRange(1.50, .75, 1.25)); 31 Assert.InRange(1.0, .75, 1.25); 37 var ex = Record.Exception(() => Assert.InRange(0, 1, 2)); 51 var ex = Record.Exception(() => Assert.InRange(2, 0, 1)); 65 Assert.InRange(2, 1, 3); 71 var ex = Record.Exception(() => Assert.InRange("adam", "bob", "scott")); 85 Assert.InRange("bob", "adam", "scott");
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Windows\WindowsSnapshotProviderTests.cs (1)
158Assert.InRange(usage, 0, long.MaxValue);
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\HttpClientLoggerTest.cs (1)
1022Assert.InRange(int.Parse(actualValue), 0, int.MaxValue);
Microsoft.ML.AutoML.Tests (1)
AutoFitTests.cs (1)
402Assert.InRange(result.BestRun.ValidationMetrics.MicroAccuracy, 0.1, 0.9);
Microsoft.ML.IntegrationTests (21)
Common.cs (19)
168Assert.InRange(metrics.AreaUnderRocCurve, 0, 1); 169Assert.InRange(metrics.DetectionRateAtFalsePositiveCount, 0, 1); 178Assert.InRange(metrics.Accuracy, 0, 1); 179Assert.InRange(metrics.AreaUnderRocCurve, 0, 1); 180Assert.InRange(metrics.AreaUnderPrecisionRecallCurve, 0, 1); 181Assert.InRange(metrics.F1Score, 0, 1); 182Assert.InRange(metrics.NegativePrecision, 0, 1); 183Assert.InRange(metrics.NegativeRecall, 0, 1); 184Assert.InRange(metrics.PositivePrecision, 0, 1); 185Assert.InRange(metrics.PositiveRecall, 0, 1); 198Assert.InRange(metrics.Entropy, double.NegativeInfinity, 1); 199Assert.InRange(metrics.LogLoss, double.NegativeInfinity, 1); 200Assert.InRange(metrics.LogLossReduction, double.NegativeInfinity, 100); 226Assert.InRange(metrics.MacroAccuracy, 0, 1); 227Assert.InRange(metrics.MicroAccuracy, 0, 1); 229Assert.InRange(metrics.TopKAccuracy, 0, 1); 246Assert.InRange(precision, 0, 1); 249Assert.InRange(recall, 0, 1); 262Assert.InRange(ndcg, 0, 100);
DataTransformation.cs (2)
186Assert.InRange(row.Features[i], -1, 1); 214Assert.InRange(row.Features[i], (uint)0, (uint)Math.Pow(2, 31));
Microsoft.ML.OnnxTransformerTest (8)
DnnImageFeaturizerTest.cs (4)
177Assert.InRange(val, 0.0, 0.00001); 179Assert.InRange(val, 0.62935, 0.62940); 181Assert.InRange(val, 0.15521, 0.155225); 185Assert.InRange(sum, 83.50, 84.50);
OnnxTransformTests.cs (4)
222Assert.InRange(val, 0.00004, 0.00005); 224Assert.InRange(val, 0.003844, 0.003845); 226Assert.InRange(val, 0.0029566, 0.0029567); 230Assert.InRange(sum, 0.99999, 1.00001);
Microsoft.ML.Sweeper.Tests (10)
TestSweeper.cs (10)
114Assert.InRange(val, 10, 20); 119Assert.InRange(val, 100, 200); 413Assert.InRange(val, 1, 5); 418Assert.InRange(val, 1, 1000); 573Assert.InRange(val, 1, 5); 578Assert.InRange(val, 1, 1000); 621Assert.InRange(val, 1, 5); 626Assert.InRange(val, 1, 1000); 672Assert.InRange(val, 1, 5); 677Assert.InRange(val, 1, 1000);
Microsoft.ML.TensorFlow.Tests (16)
TensorflowTests.cs (16)
730Assert.InRange(metrics.MicroAccuracy, expectedMicroAccuracy, 1); 731Assert.InRange(metrics.MacroAccuracy, expectedMacroAccruacy, 1); 852Assert.InRange(metrics.MicroAccuracy, expectedMicroAccuracy - 0.1, expectedMicroAccuracy + 0.1); 853Assert.InRange(metrics.MacroAccuracy, expectedMacroAccuracy - 0.1, expectedMacroAccuracy + 0.1); 1299Assert.InRange(prediction.Prediction[1], 0.650032759 - 0.01, 0.650032759 + 0.01); 1436Assert.InRange(metrics.MicroAccuracy, 0.8, 1); 1437Assert.InRange(metrics.MacroAccuracy, 0.8, 1); 1539Assert.InRange(metrics.MicroAccuracy, 0.8, 1); 1540Assert.InRange(metrics.MacroAccuracy, 0.8, 1); 1698Assert.InRange(metrics.MicroAccuracy, 0.8, 1); 1699Assert.InRange(metrics.MacroAccuracy, 0.8, 1); 1828Assert.InRange(metrics.MicroAccuracy, 0.8, 1); 1829Assert.InRange(metrics.MacroAccuracy, 0.8, 1); 1832Assert.InRange(lastEpoch, 1, 49); 1901Assert.InRange(metrics.MicroAccuracy, 0.3, 1); 1902Assert.InRange(metrics.MacroAccuracy, 0.3, 1);
Microsoft.ML.Tests (42)
AnomalyDetectionTests.cs (10)
168Assert.InRange(results[i].Score, 0, 0.5); 173Assert.InRange(results[7].Score, 0.5, 1); 210Assert.InRange(results[0].Score, 0.3, 1); 213Assert.InRange(results[1].Score, 0, 0.3); 216Assert.InRange(results[2].Score, 0, 0.3); 219Assert.InRange(results[3].Score, 0.3, 1); 223Assert.InRange(results[4].Score, 0, 0.3); 227Assert.InRange(results[5].Score, 0, 0.3); 230Assert.InRange(results[6].Score, 0, 0.3); 234Assert.InRange(results[7].Score, 0.3, 1);
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (1)
95Assert.InRange(metrics.LogLossReduction, 0.94, 0.96);
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (2)
97Assert.InRange(metrics.LogLoss, .05, .06); 98Assert.InRange(metrics.LogLossReduction, 0.94, 0.96);
TrainerEstimators\CalibratorEstimators.cs (1)
138Assert.InRange((float)probability.Value, 0, 1);
TrainerEstimators\FAFMEstimator.cs (6)
34Assert.InRange(metrics.Accuracy, 0.6, 1); 35Assert.InRange(metrics.AreaUnderRocCurve, 0.7, 1); 36Assert.InRange(metrics.AreaUnderPrecisionRecallCurve, 0.65, 1); 60Assert.InRange(metrics.Accuracy, 0.9, 1); 61Assert.InRange(metrics.AreaUnderRocCurve, 0.9, 1); 62Assert.InRange(metrics.AreaUnderPrecisionRecallCurve, 0.9, 1);
TrainerEstimators\MatrixFactorizationTests.cs (6)
138Assert.InRange(metrices.MeanSquaredError, expectedLinuxMeanSquaredError - linuxTolerance, expectedLinuxMeanSquaredError + linuxTolerance); 144Assert.InRange(metrices.MeanSquaredError, expectedMacMeanSquaredError - windowsAndMacTolerance, expectedMacMeanSquaredError + windowsAndMacTolerance); 150Assert.InRange(metrices.MeanSquaredError, expectedWindowsMeanSquaredError - windowsAndMacTolerance, expectedWindowsMeanSquaredError + windowsAndMacTolerance); 362Assert.InRange(metrics.MeanSquaredError, 0, 0.1); 475Assert.InRange(metrics.MeanSquaredError, 0, 0.0016); 619Assert.InRange(metrics.MeanSquaredError, 0, 0.0016);
TrainerEstimators\SdcaTests.cs (8)
85Assert.InRange(metrics.AreaUnderRocCurve, 0.9, 1); 86Assert.InRange(metrics.LogLoss, 0, 0.5); 97Assert.InRange(first.Probability, 0.8, 1); 245Assert.InRange(metrics.AreaUnderRocCurve, 0.9, 1); 288Assert.InRange(metrics.TopKAccuracy, 0.8, 1); 289Assert.InRange(metrics.LogLoss, 0, 0.5); 322Assert.InRange(metrics.TopKAccuracy, 0.8, 1); 323Assert.InRange(metrics.MacroAccuracy, 0.8, 1);
TrainerEstimators\TrainerEstimators.cs (7)
110Assert.InRange(metrics.Accuracy, 0.8, 1); 111Assert.InRange(metrics.AreaUnderRocCurve, 0.9, 1); 112Assert.InRange(metrics.LogLoss, 0, 0.6); 141Assert.InRange(metrics.Accuracy, 0.7, 1); 142Assert.InRange(metrics.AreaUnderRocCurve, 0.9, 1); 182Assert.InRange(metrics.Accuracy, 0.7, 1); 183Assert.InRange(metrics.AreaUnderRocCurve, 0.9, 1);
Transformers\CopyColumnEstimatorTests.cs (1)
151Assert.InRange<ulong>(key.Count, 0, int.MaxValue);
Sockets.FunctionalTests (2)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (2)
188Assert.InRange(bytesWritten, minimumExpectedBytesWritten, maximumExpectedBytesWritten); 278Assert.InRange(bytesWritten, minimumExpectedBytesWritten, maximumExpectedBytesWritten);
System.Drawing.Common.Tests (1)
System\Drawing\GdiPlusHandlesTests.cs (1)
44Assert.InRange(finalHandles, initialHandles - HandleThreshold, initialHandles + HandleThreshold);
System.Windows.Forms.Tests (9)
System\Windows\Forms\Printing\PrintPreviewControl.PrintPreviewControlAccessibilityObjectTests.cs (2)
164Assert.InRange((int)scrollProvider.VerticalScrollPercent, 0, 100); 178Assert.InRange((int)scrollProvider.HorizontalScrollPercent, 0, 100);
System\Windows\Forms\ScreenTests.cs (5)
211Assert.InRange(screen.DeviceName.Length, 1, 32); 213Assert.InRange(screen.WorkingArea.Width, 0, screen.Bounds.Width); 214Assert.InRange(screen.WorkingArea.Height, 0, screen.Bounds.Height); 215Assert.InRange(screen.WorkingArea.X, screen.Bounds.X, screen.Bounds.X + screen.Bounds.Width); 216Assert.InRange(screen.WorkingArea.Y, screen.Bounds.Y, screen.Bounds.Y + screen.Bounds.Width);
System\Windows\Forms\SystemInformationTests.cs (2)
108Assert.InRange(name.Length, 1, 256); 741Assert.InRange(name.Length, 1, 256);