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

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

71 Examples 7

1. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
        public void FailureMessage()
        {
			expectedMessage =
				"  Expected: less than or equal to 4" + Environment.NewLine +
				"  But was:  9" + Environment.NewLine;
            Assert.LessOrEqual(9, 4);
        }

2. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
        public void FailureMessage()
        {
			expectedMessage =
				"  Expected: less than or equal to 4" + Environment.NewLine +
				"  But was:  9" + Environment.NewLine;
            Assert.LessOrEqual(9, 4);
        }

3. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
        public void NotLessOrEqual()
        {
			expectedMessage =
				"  Expected: less than or equal to 5" + Environment.NewLine +
				"  But was:  8" + Environment.NewLine;
			Assert.LessOrEqual(i2, i1);
        }

4. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
        public void NotLessOrEqual()
        {
			expectedMessage =
				"  Expected: less than or equal to 5" + Environment.NewLine +
				"  But was:  8" + Environment.NewLine;
			Assert.LessOrEqual(i2, i1);
        }

5. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
        public void NotLessOrEqual()
        {
			expectedMessage =
				"  Expected: less than or equal to 5" + Environment.NewLine +
				"  But was:  8" + Environment.NewLine;
			Assert.LessOrEqual(i2, i1);
        }

6. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
        public void FailureMessage()
        {
			expectedMessage =
				"  Expected: less than or equal to 4" + Environment.NewLine +
				"  But was:  9" + Environment.NewLine;
            Assert.LessOrEqual(9, 4);
        }

7. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
        public void FailureMessage()
        {
			expectedMessage =
				"  Expected: less than or equal to 4" + Environment.NewLine +
				"  But was:  9" + Environment.NewLine;
            Assert.LessOrEqual(9, 4);
        }

8. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
        public void FailureMessage()
        {
			expectedMessage =
				"  Expected: less than or equal to 4" + Environment.NewLine +
				"  But was:  9" + Environment.NewLine;
            Assert.LessOrEqual(9, 4);
        }

9. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
        public void NotLessOrEqual()
        {
			expectedMessage =
				"  Expected: less than or equal to 5" + Environment.NewLine +
				"  But was:  8" + Environment.NewLine;
			Assert.LessOrEqual(i2, i1);
        }

10. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
        public void NotLessOrEqual()
        {
			expectedMessage =
				"  Expected: less than or equal to 5" + Environment.NewLine +
				"  But was:  8" + Environment.NewLine;
			Assert.LessOrEqual(i2, i1);
        }

11. Example

Project: AutoTest.Net
Source File: LessEqualFixture.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
        public void FailureMessage()
        {
			expectedMessage =
				"  Expected: less than or equal to 4" + Environment.NewLine +
				"  But was:  9" + Environment.NewLine;
            Assert.LessOrEqual(9, 4);
        }

12. Example

Project: ContinuousTests
Source File: LessEqualFixture.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
        public void NotLessOrEqual()
        {
			expectedMessage =
				"  Expected: less than or equal to 5" + Environment.NewLine +
				"  But was:  8" + Environment.NewLine;
			Assert.LessOrEqual(i2, i1);
        }

13. Example

Project: SharpMap
Source File: SQLServer2008Tests.cs
View license
[NUnit.Framework.Test()]
        public void TestGetFeatureCountWithDefinitionQuery()
        {
            SharpMap.Data.Providers.SqlServer2008 sq = GetTestProvider();

            sq.DefinitionQuery = "NAME LIKE 'A%'";

            int count = sq.GetFeatureCount();

            Assert.LessOrEqual(count, 100);
        }

14. Example

Project: SharpMap
Source File: PostGisGeographyTests.cs
View license
[Test]
        public void TestGetFeatureCountWithDefinitionQuery()
        {
            foreach (var sq in GetTestProvider())
            {

                sq.DefinitionQuery = "NAME LIKE 'A%'";

                int count = sq.GetFeatureCount();

                Assert.LessOrEqual(count, 100);
            }
        }

15. Example

Project: oxyplot
Source File: AxisUtilitiesTests.cs
View license
[Test]
        public void CreateTickValuesForFloatingPointAccumulation()
        {
            var values = AxisUtilities.CreateTickValues(0.58666699999999994, 0.9233, 0.05);
            foreach (var val in values)
            {
                Assert.LessOrEqual(string.Format("{0:}", val).Length, 4);
            }
        }

16. Example

Project: SharpMap
Source File: PostGisTests.cs
View license
[Test]
        public void TestGetFeatureCountWithDefinitionQuery()
        {
            var sq = GetTestProvider();

            sq.DefinitionQuery = "NAME LIKE 'A%'";

            int count = sq.GetFeatureCount();

            Assert.LessOrEqual(count, 100);
        }

17. Example

Project: linq2db
Source File: MergeTests.cs
View license
private void AssertRowCount(int expected, int actual, string context)
		{
			// another sybase quirk, nothing surprising
			if (context == ProviderName.Sybase)
				Assert.LessOrEqual(expected, actual);
			else if (context == ProviderName.OracleNative && actual == -1)
			{ }
			else
				Assert.AreEqual(expected, actual);
		}

18. Example

Project: Tigwi
Source File: MessageTest.cs
View license
[Test]
        //Big test on numbers
        public void GetListsMsgFromNormalBehaviourOnBigNumbers()
        {
            int k;
            for (k = 0; k < 600; k++)
            {
                storage.Msg.Post(_accountId, Hw);
            }

            var lists = new HashSet<Guid> { storage.List.GetPersonalList(_accountId) };
            var messages = storage.Msg.GetListsMsgFrom(lists, _date, 333);
            Assert.AreEqual(messages.Count(), 333);
            foreach (var message in messages)
            {
                Assert.LessOrEqual(_date.CompareTo(message.Date), 0);
            }
        }

19. Example

View license
[Test]
        public void Each_Output_Line_Contains_No_More_Than_Five_Items()
        {
            var outputFormatter = new OutputFormatter();

            IList<string> formattedOutput = outputFormatter.Format(_generatedPrimes);

            string[] splitPrimes;

            foreach (string item in formattedOutput)
            {
                splitPrimes = item.Split(",".ToCharArray());

                Assert.LessOrEqual(splitPrimes.Length, 5);
            }
        }

20. Example

Project: mathnet-numerics
Source File: ZipfTests.cs
View license
[Test]
        public void CanSample()
        {
            var d = new Zipf(0.7, 5);
            var s = d.Sample();
            Assert.LessOrEqual(s, 5);
            Assert.GreaterOrEqual(s, 0);
        }

21. Example

Project: FieldWorks
Source File: EthnologueTests.cs
View license
[Test]
		public void TestGetLanguagesInCountry()
		{
			Ethnologue eth = new Ethnologue();
			List<Ethnologue.Names> res = eth.GetLanguagesInCountry("United States", true);
			Assert.GreaterOrEqual(res.Count, 200);
			Assert.LessOrEqual(res.Count, 250);
			Assert.AreEqual("aaq", res[0].EthnologueCode);

			List<Ethnologue.Names> res2 = eth.GetLanguagesInCountry("United States", false);
			Assert.GreaterOrEqual(res2.Count, 1000);
			Assert.AreEqual("eng", res2[0].EthnologueCode);
			Assert.AreEqual("AAVE", res2[0].LangName);
		}

22. Example

Project: AutoTest.Net
Source File: AssemblyLoadTests.cs
View license
[Test]
        public void Load1000TestsInTestDomain()
        {
            runner = new TestDomain();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

23. Example

Project: AutoTest.Net
Source File: AssemblyLoadTests.cs
View license
[Test]
        public void Load1000TestsUsingTestLoader()
        {
            loader = new TestLoader();
            int start = Environment.TickCount;
            loader.LoadProject("loadtest-assembly.dll");
            Assert.IsTrue(loader.IsProjectLoaded);
            loader.LoadTest();
            Assert.IsTrue(loader.IsTestLoaded);
            Assert.AreEqual(2050, loader.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

24. Example

View license
[Test]
        public void Load1000TestsInTestDomain()
        {
            runner = new TestDomain();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

25. Example

View license
[Test]
        public void Load1000TestsInTestDomain()
        {
            runner = new TestDomain();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

26. Example

Project: nunit
Source File: LessEqualFixture.cs
View license
[Test]
        public void NotLessOrEqual()
        {
            var expectedMessage =
                "  Expected: less than or equal to 5" + Environment.NewLine +
                "  But was:  8" + Environment.NewLine;
            var ex = Assert.Throws<AssertionException>(() => Assert.LessOrEqual(i2, i1));
            Assert.That(ex.Message, Is.EqualTo(expectedMessage));
        }

27. Example

Project: nunit
Source File: LessEqualFixture.cs
View license
[Test]
        public void FailureMessage()
        {
            var expectedMessage =
                "  Expected: less than or equal to 4" + Environment.NewLine +
                "  But was:  9" + Environment.NewLine;
            var ex = Assert.Throws<AssertionException>(() => Assert.LessOrEqual(9, 4));
            Assert.That(ex.Message, Is.EqualTo(expectedMessage));
        }

28. Example

Project: AutoTest.Net
Source File: AssemblyLoadTests.cs
View license
[Test]
        public void Load1000TestsUsingTestLoader()
        {
            loader = new TestLoader();
            int start = Environment.TickCount;
            loader.LoadProject("loadtest-assembly.dll");
            Assert.IsTrue(loader.IsProjectLoaded);
            loader.LoadTest();
            Assert.IsTrue(loader.IsTestLoaded);
            Assert.AreEqual(2050, loader.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

29. Example

Project: AutoTest.Net
Source File: AssemblyLoadTests.cs
View license
[Test]
        public void Load1000TestsInTestDomain()
        {
            runner = new TestDomain();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

30. Example

Project: AutoTest.Net
Source File: AssemblyLoadTests.cs
View license
[Test]
        public void Load1000TestsInSameDomain()
        {
            runner = new SimpleTestRunner();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

31. Example

View license
[Test]
        public void Load1000TestsInSameDomain()
        {
            runner = new SimpleTestRunner();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

32. Example

View license
[Then(@"I should see at most ([\d,]+) results")]
        public void ThenIShouldSeeAtMostNumberOfResults(string expMaxNumberResults)
        {
            expMaxNumberResults = expMaxNumberResults.Replace(",", "");
            Assert.LessOrEqual(Convert.ToInt32(GoogleSearchResultsPage.NumberOfResults), Convert.ToInt32(expMaxNumberResults));
        }

33. Example

View license
[Test]
        public void Load1000TestsUsingTestLoader()
        {
            loader = new TestLoader();
            int start = Environment.TickCount;
            loader.LoadProject("loadtest-assembly.dll");
            Assert.IsTrue(loader.IsProjectLoaded);
            loader.LoadTest();
            Assert.IsTrue(loader.IsTestLoaded);
            Assert.AreEqual(2050, loader.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

34. Example

Project: AutoTest.Net
Source File: AssemblyLoadTests.cs
View license
[Test]
        public void Load1000TestsInSameDomain()
        {
            runner = new SimpleTestRunner();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

35. Example

View license
[Test]
        public void Load1000TestsInSameDomain()
        {
            runner = new SimpleTestRunner();
            int start = Environment.TickCount;
            Assert.IsTrue(runner.Load(new TestPackage("loadtest-assembly.dll")));
            ITest test = runner.Test;
            Assert.AreEqual(2050, test.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

36. Example

View license
[Test]
        public void Load1000TestsUsingTestLoader()
        {
            loader = new TestLoader();
            int start = Environment.TickCount;
            loader.LoadProject("loadtest-assembly.dll");
            Assert.IsTrue(loader.IsProjectLoaded);
            loader.LoadTest();
            Assert.IsTrue(loader.IsTestLoaded);
            Assert.AreEqual(2050, loader.TestCount);
            int ms = Environment.TickCount - start;
            Console.WriteLine("Loaded in {0}ms", ms);
            Assert.LessOrEqual(ms, 4000);
        }

37. Example

Project: FieldWorks
Source File: DiffTestHelper.cs
View license
public static void VerifySubDiffParaAdded(Difference rootDiff, int iSubDiff,
			DifferenceType subDi/n ..... /n //View Source file for more details /n }

38. Example

View license
[Test]
        public void Generate_Bulk_Import_Sql_Exceeding_Max_Params()
        {
            // Arrange
            var db = DatabaseContext.Database;

            var servers = new List<ServerRegistrationDto>();
            for (var i = 0; i < 1500; i++)
            {
                servers.Add(new ServerRegistrationDto
                {
                    ServerAddress = "address" + i,
                    ServerIdentity = "computer" + i,
                    DateRegistered = DateTime.Now,
                    IsActive = true,
                    DateAccessed = DateTime.Now,
                    IsMaster = true
                });
            }
            db.OpenSharedConnection();

            // Act
            string[] sql;
            db.GenerateBulkInsertCommand(Database.PocoData.ForType(typeof(ServerRegistrationDto)), servers, out sql);
            db.CloseSharedConnection();

            // Assert
            Assert.That(sql.Length, Is.EqualTo(5));
            foreach (var s in sql)
            {
                Assert.LessOrEqual(Regex.Matches(s, "@\\d+").Count, 2000);
            }
        }

39. Example

Project: mathnet-numerics
Source File: BisectionTest.cs
View license
[Test]
        public void Accuracy()
        {
            // Verify that x-accuracy is being sough/n ..... /n //View Source file for more details /n }

40. Example

Project: libpalaso
Source File: ExtractCopyrightTests.cs
View license
[Test]
		public void CreateCopyrightFileWorks()
		{
			var copyrights = SIL.ExtractCopyright.Copyrig/n ..... /n //View Source file for more details /n }

41. Example

Project: SharpMap
Source File: GdiImageLayerTest.cs
View license
[Test]
        public void TestTransparency()
        {
            var tmpFile = GdiImageLayerTest.CreateImage(new Size(300, 300), new Point(10, 10));
            using(var l = new GdiImageLayer(tmpFile))
            using (var pl = new GdiImageLayerProxy<GdiImageLayer>(l, 0.3f))
            using (var m = new Map(new Size(450, 450)))
            {
                m.Layers.Add(pl);
                m.ZoomToExtents();
                using (var img = (Bitmap)m.GetMap())
                {
                    var color = img.GetPixel(225, 225);
                    Assert.LessOrEqual(Math.Abs((int)Math.Round(0.3f*255, MidpointRounding.AwayFromZero) - color.A),1);
                }
            }
            GdiImageLayerTest.DeleteTmpFiles(tmpFile);
        }

42. Example

Project: cs-schtick
Source File: SchtickTests.cs
View license
[Test]
        public void BasicExamples()
        {
            var schtick = new Schtick();
            Exception taskEx = null;
            schtick.OnTaskException += (task, exception) => taskEx = exception;

            var allRecords = new List<RunRecord>();
            var all = schtick.AddTask("all", "sec(*)", (task, run) => { allRecords.Add(new RunRecord(DateTimeOffset.UtcNow, run)); });

            var evenRecords = new List<RunRecord>();
            var even = schtick.AddTask("even", "sec(*%2)", (task, run) => { evenRecords.Add(new RunRecord(DateTimeOffset.UtcNow, run)); });

            // give them a chance to run
            Thread.Sleep(4000);

            // look at the results
            all.StopSchedule();
            even.StopSchedule();

            Assert.IsNull(taskEx);

            Assert.GreaterOrEqual(allRecords.Count, 3);
            Assert.LessOrEqual(allRecords.Count, 5);
            Assert.GreaterOrEqual(evenRecords.Count, 1);
            Assert.LessOrEqual(evenRecords.Count, 3);

            // make sure all of the events are within 100 milliseconds of the intended time
            foreach (var r in allRecords.Concat(evenRecords))
            {
                Assert.LessOrEqual(r.MillisecondsDifference, 100);
            }
        }

43. Example

Project: AutoTest.Net
Source File: StatusBarTests.cs
View license
private void OnTestFinished( object sender, TestEventArgs e )
		{
			Assert.AreEqual( 
				PanelMessage( "Test Cases", MockAssembly.Tests ),
				statusBar.Panels[1].Text );

            StringAssert.EndsWith( e.Result.Test.TestName.Name, statusBar.Panels[0].Text );
            
		    string runPanel = statusBar.Panels[2].Text;
		    int testsRun = 0;
            if (runPanel != "")
            {
                StringAssert.StartsWith( "Tests Run : ", runPanel );
                testsRun = int.Parse(runPanel.Substring(12));
            }

            Assert.GreaterOrEqual( testsRun, testCount);
            Assert.LessOrEqual( testsRun, testCount + 1);
		    testCount = testsRun;
   		}

44. Example

Project: AutoTest.Net
Source File: StatusBarTests.cs
View license
private void OnTestFinished( object sender, TestEventArgs e )
		{
			Assert.AreEqual( 
				PanelMessage( "Test Cases", MockAssembly.Tests ),
				statusBar.Panels[1].Text );

            StringAssert.EndsWith( e.Result.Test.TestName.Name, statusBar.Panels[0].Text );
            
		    string runPanel = statusBar.Panels[2].Text;
		    int testsRun = 0;
            if (runPanel != "")
            {
                StringAssert.StartsWith( "Tests Run : ", runPanel );
                testsRun = int.Parse(runPanel.Substring(12));
            }

            Assert.GreaterOrEqual( testsRun, testCount);
            Assert.LessOrEqual( testsRun, testCount + 1);
		    testCount = testsRun;
   		}

45. Example

Project: ContinuousTests
Source File: StatusBarTests.cs
View license
private void OnTestFinished( object sender, TestEventArgs e )
		{
			Assert.AreEqual( 
				PanelMessage( "Test Cases", MockAssembly.Tests ),
				statusBar.Panels[1].Text );

            StringAssert.EndsWith( e.Result.Test.TestName.Name, statusBar.Panels[0].Text );
            
		    string runPanel = statusBar.Panels[2].Text;
		    int testsRun = 0;
            if (runPanel != "")
            {
                StringAssert.StartsWith( "Tests Run : ", runPanel );
                testsRun = int.Parse(runPanel.Substring(12));
            }

            Assert.GreaterOrEqual( testsRun, testCount);
            Assert.LessOrEqual( testsRun, testCount + 1);
		    testCount = testsRun;
   		}

46. Example

Project: ContinuousTests
Source File: StatusBarTests.cs
View license
private void OnTestFinished( object sender, TestEventArgs e )
		{
			Assert.AreEqual( 
				PanelMessage( "Test Cases", MockAssembly.Tests ),
				statusBar.Panels[1].Text );

            StringAssert.EndsWith( e.Result.Test.TestName.Name, statusBar.Panels[0].Text );
            
		    string runPanel = statusBar.Panels[2].Text;
		    int testsRun = 0;
            if (runPanel != "")
            {
                StringAssert.StartsWith( "Tests Run : ", runPanel );
                testsRun = int.Parse(runPanel.Substring(12));
            }

            Assert.GreaterOrEqual( testsRun, testCount);
            Assert.LessOrEqual( testsRun, testCount + 1);
		    testCount = testsRun;
   		}

47. Example

Project: ContinuousTests
Source File: StatusBarTests.cs
View license
private void OnTestFinished( object sender, TestEventArgs e )
		{
			Assert.AreEqual( 
				PanelMessage( "Test Cases", MockAssembly.Tests ),
				statusBar.Panels[1].Text );

            StringAssert.EndsWith( e.Result.Test.TestName.Name, statusBar.Panels[0].Text );
            
		    string runPanel = statusBar.Panels[2].Text;
		    int testsRun = 0;
            if (runPanel != "")
            {
                StringAssert.StartsWith( "Tests Run : ", runPanel );
                testsRun = int.Parse(runPanel.Substring(12));
            }

            Assert.GreaterOrEqual( testsRun, testCount);
            Assert.LessOrEqual( testsRun, testCount + 1);
		    testCount = testsRun;
   		}

48. Example

Project: AutoTest.Net
Source File: StatusBarTests.cs
View license
private void OnTestFinished( object sender, TestEventArgs e )
		{
			Assert.AreEqual( 
				PanelMessage( "Test Cases", MockAssembly.Tests ),
				statusBar.Panels[1].Text );

            StringAssert.EndsWith( e.Result.Test.TestName.Name, statusBar.Panels[0].Text );
            
		    string runPanel = statusBar.Panels[2].Text;
		    int testsRun = 0;
            if (runPanel != "")
            {
                StringAssert.StartsWith( "Tests Run : ", runPanel );
                testsRun = int.Parse(runPanel.Substring(12));
            }

            Assert.GreaterOrEqual( testsRun, testCount);
            Assert.LessOrEqual( testsRun, testCount + 1);
		    testCount = testsRun;
   		}

49. Example

Project: AngleSharp
Source File: MutationObserver.cs
View license
[Test]
        public void MutationObserverAttrCallback()
        {
            var document = Html("");
            var testDiv = document.Body.AppendChild(document.CreateElement("div"));
            var div = testDiv.AppendChild(document.CreateElement("div"));
            var child = document.CreateElement("div");
            div.AppendChild(child);
            var i = 0;
            var observer = new MutationObserver((records, obs) =>
            {
                Assert.LessOrEqual(++i, 2);
                Assert.AreEqual(1, records.Count());

                AssertRecord(records[0], new TestMutationRecord
                {
                    Type = "attributes",
                    Target = child,
                    AttributeName = "a",
                    AttributeNamespace = null
                });

                // The transient observers are removed before the callback is called.
                child.SetAttribute("b", "B");
                records = obs.Flush().ToArray();
                Assert.AreEqual(0, records.Count());
            });

            observer.Connect(div, attributes: true, subtree: true);

            div.RemoveChild(child);
            child.SetAttribute("a", "A");
            observer.Trigger();
        }

50. Example

Project: AngleSharp
Source File: MutationObserver.cs
View license
[Test]
        public void MutationObserverCharacterdataCallback()
        {
            var document = Html("");
            var div = document.CreateElement("div");
            var child = div.AppendChild(document.CreateTextNode("text"));
            var i = 0;
            var observer = new MutationObserver((records, obs) =>
            {
                Assert.LessOrEqual(++i, 2);
                Assert.AreEqual(1, records.Count());

                AssertRecord(records[0], new TestMutationRecord
                {
                    Type = "characterData",
                    Target = child
                });

                // The transient observers are removed before the callback is called.
                child.TextContent += " again";
                records = obs.Flush().ToArray();
                Assert.AreEqual(0, records.Count());
            });
            observer.Connect(div, characterData: true, subtree: true);
            div.RemoveChild(child);
            child.TextContent = "changed";
            observer.Trigger();
        }