NUnit.Framework.Assert.LessOrEqual(int, int, string)

Here are the examples of the csharp api class NUnit.Framework.Assert.LessOrEqual(int, int, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

17 Examples 7

1. Example

Project: riak-dotnet-client
Source File: Extensions.cs
View license
public static void ShouldBeLessThan(this int actual, int expected, string message = null)
        {
            Assert.LessOrEqual(actual, expected, message);
        }

2. Example

Project: spring-net
Source File: TriggerObjectTest.cs
View license
protected static void AssertDateTimesEqualityWithAllowedDelta(DateTimeOffset d1, DateTimeOffset d2, int allowedDeltaInMilliseconds)
        {
            int diffInMillis = (int) Math.Abs((d1 - d2).TotalMilliseconds);
            Assert.LessOrEqual(diffInMillis, allowedDeltaInMilliseconds, "too much difference in times");
        }

3. Example

View license
public void minimumFanSpeedLessThanOrEqualToOneHundred(PrinterSettingsLayer layer, string sourceFile)
		{
			string settingValue;
			if (!layer.TryGetValue("min_fan_speed", out settingValue))
			{
				return;
			}

			Assert.LessOrEqual(int.Parse(settingValue), 100, "min_fan_speed should be less than or equal to 100: " + sourceFile);
		}

4. Example

View license
public void maxFanSpeedNotGreaterThanOneHundred(PrinterSettingsLayer layer, string sourceFile)
		{
			string settingValue;
			if (!layer.TryGetValue("max_fan_speed", out settingValue))
			{
				return;
			}

			Assert.LessOrEqual(int.Parse(settingValue), 100, "max_fan_speed should be less than or equal to 100: " + sourceFile);
		}

5. Example

View license
[Test]
        public void ParametersTest_CoverAndAttachmentPage()
        {
            _pdfDevice.Job.Profile.OutputFormat = OutputFormat.Pdf;
            _pdfDevice.Job.Profile.CoverPage.Enabled = true;
            const string coverFile = "CoverFile.pdf";
            _pdfDevice.Job.Profile.CoverPage.File = coverFile;
            _pdfDevice.Job.Profile.AttachmentPage.Enabled = true;
            const string attachmentFile = "AttachmentFile.pdf";
            _pdfDevice.Job.Profile.AttachmentPage.File = attachmentFile;

            _parameterStrings = new Collection<string>(_pdfDevice.GetGhostScriptParameters(_ghostscriptVersion));

            var coverIndex = _parameterStrings.IndexOf(coverFile);
            var attachmentIndex = _parameterStrings.IndexOf(attachmentFile);

            Assert.LessOrEqual(coverIndex - attachmentIndex, -2, "No further (file)parameter between cover and attachment file.");
        }

6. Example

Project: PDFCreator
Source File: GeneralTests.cs
View license
[Test]
        public void ParametersTest_CoverAndAttachmentPage()
        {
            _outputDevice.Job.Profile.CoverPage.Enabled = true;
            const string coverFile = "CoverFile.pdf";
            _outputDevice.Job.Profile.CoverPage.File = coverFile;
            _outputDevice.Job.Profile.AttachmentPage.Enabled = true;
            const string attachmentFile = "AttachmentFile.pdf";
            _outputDevice.Job.Profile.AttachmentPage.File = attachmentFile;

            _parameterStrings = new Collection<string>(_outputDevice.GetGhostScriptParameters(_ghostscriptVersion));

            var coverIndex = _parameterStrings.IndexOf(coverFile);
            var attachmentIndex = _parameterStrings.IndexOf(attachmentFile);

            Assert.LessOrEqual(coverIndex - attachmentIndex, -2,
                "No further (file)parameter between cover and attachment file.");
        }

7. Example

View license
public void UniformUniquenessByBits(int numPoints, int dimensions, int smallBucketSize, int maxCoordinate)
        {
            var points = TestDataHelper.UniformRandomPoints(numPoints, dimensions, maxCoordinate);
            PointBalancer balancer = null;
            var bitsRequired = (maxCoordinate + 1).SmallestPowerOfTwo();
            var maxBucketSize = new int[bitsRequired];
            for (var iBits = 1; iBits <= bitsRequired; iBits++)
            {
                maxBucketSize[iBits-1] = MaxBucketSizePerBits(points, iBits, smallBucketSize, ref balancer, out int pointsInSmallBuckets);
                var pctInSmallBuckets = 100.0 * pointsInSmallBuckets / points.Count;
                Console.WriteLine($"Bits: {iBits}  Max Bucket: {maxBucketSize[iBits-1]}  # in Small Buckets: {pointsInSmallBuckets} - {pctInSmallBuckets} %");
            }
            Assert.LessOrEqual(maxBucketSize[0], 2, $"Even a one-bit Hilbert curve should be enough to distinguish random points, but maxBucketSize is {maxBucketSize[0]}");
        }

8. Example

View license
private void AssertComponentOrder(IEnumerable<Component> components, int count, ComponentExecutionOrder order, bool reverseOrder)
		{
			int actualCount = components.Count();
			Assert.AreEqual(
				count, 
				actualCount, 
				string.Format("Expected {0} Components, but got {1}", count, actualCount));

			int lastIndex = reverseOrder ? int.MaxValue : int.MinValue;
			Type lastType = null;
			foreach (TestComponent component in components)
			{
				Type type = component.GetType();
				int index = order.GetSortIndex(type);

				if (reverseOrder)
				{
					Assert.LessOrEqual(
						index, 
						lastIndex, 
						string.Format(
							"Found {0} before {1}, which is out of the expected (reversed) order.", 
							type.Name, 
							lastType != null ? lastType.Name : "null"));
				}
				else
				{
					Assert.GreaterOrEqual(
						index, 
						lastIndex, 
						string.Format(
							"Found {0} after {1}, which is out of order.", 
							type.Name, 
							lastType != null ? lastType.Name : "null"));
				}

				lastIndex = index;
				lastType = type;
			}
		}

9. Example

Project: MatterControl
Source File: OemProfileTests.cs
View license
[Test]
		public void MinFanSpeedOneHundredOrLess()
		{
			ValidateOnAllPrinters((printer, settings) =>
			{
				string fanSpeedString = settings.GetValue("min_fan_speed");
				if (!string.IsNullOrEmpty(fanSpeedString))
				{
					// Must be valid int data
					int minFanSpeed;
					if (!int.TryParse(fanSpeedString, out minFanSpeed))
					{
						Assert.Fail("Invalid [min_fan_speed] value (int parse failed): " + printer.RelativeFilePath);
					}

					// Must be less than or equal to 100
					Assert.LessOrEqual(minFanSpeed, 100, "[min_fan_speed]: " + printer.RelativeFilePath);
				}
			});
		}

10. Example

Project: MatterControl
Source File: OemProfileTests.cs
View license
[Test]
		public void MaxFanSpeedOneHundredOrLess()
		{
			ValidateOnAllPrinters((printer, settings) =>
			{
				string fanSpeedString = settings.GetValue("max_fan_speed");
				if (!string.IsNullOrEmpty(fanSpeedString))
				{
					// Must be valid int data
					int maxFanSpeed;
					if (!int.TryParse(fanSpeedString, out maxFanSpeed))
					{
						Assert.Fail("Invalid [max_fan_speed] value (int parse failed): " + printer.RelativeFilePath);
					}

					// Must be less than or equal to 100
					Assert.LessOrEqual(maxFanSpeed, 100, "[max_fan_speed]: " + printer.RelativeFilePath);
				}
			});
		}

11. Example

Project: nunit
Source File: LessEqualFixture.cs
View license
[Test]
        public void LessOrEqual()
        {
            // Test equality check for all forms
/n ..... /n //View Source file for more details /n }

12. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test]
        public void LessOrEqual()
        {
            // Test equality check for all forms
/n ..... /n //View Source file for more details /n }

13. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test]
        public void LessOrEqual()
        {
            // Test equality check for all forms
/n ..... /n //View Source file for more details /n }

14. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test]
        public void LessOrEqual()
        {
            // Test equality check for all forms
/n ..... /n //View Source file for more details /n }

15. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test]
        public void LessOrEqual()
        {
            // Test equality check for all forms
/n ..... /n //View Source file for more details /n }

16. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test]
        public void LessOrEqual()
        {
            // Test equality check for all forms
/n ..... /n //View Source file for more details /n }

17. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test]
        public void LessOrEqual()
        {
            // Test equality check for all forms
/n ..... /n //View Source file for more details /n }