NUnit.Framework.AssertionHelper.Expect(bool)

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

22 Examples 7

1. Example

View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

2. Example

View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

3. Example

View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

4. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

5. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

6. Example

View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

7. Example

View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

8. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

9. Example

Project: grisu.net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

10. Example

View license
[Test]
        public void IsTrue()
        {
            // Classic syntax
            Assert.IsTrue(2+2==4);

            // Constraint Syntax
            Assert.That(2+2==4, Is.True);
            Assert.That(2+2==4);

            // Inherited syntax
            Expect(2+2==4, True);
            Expect(2+2==4);
        }

11. Example

Project: Pash
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsTrue()
		{
			// Classic syntax
			Assert.IsTrue(2+2==4);

			// Helper syntax
			Assert.That(2+2==4, Is.True);
			Assert.That(2+2==4);

			// Inherited syntax
			Expect(2+2==4, True);
			Expect(2+2==4);
		}

12. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

13. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

14. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

15. Example

Project: Pash
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

16. Example

View license
[Test]
        public void EqualityTests()
        {
            int[] i3 = new int[] { 1, 2, 3 };
            double[] d3 = new double[] { 1.0, 2.0, 3.0 };
            int[] iunequal = new int[] { 1, 3, 2 };

            // Classic Syntax
            Assert.AreEqual(4, 2 + 2);
            Assert.AreEqual(i3, d3);
            Assert.AreNotEqual(5, 2 + 2);
            Assert.AreNotEqual(i3, iunequal);

            // Constraint Syntax
            Assert.That(2 + 2, Is.EqualTo(4));
            Assert.That(2 + 2 == 4);
            Assert.That(i3, Is.EqualTo(d3));
            Assert.That(2 + 2, Is.Not.EqualTo(5));
            Assert.That(i3, Is.Not.EqualTo(iunequal));
        
            // Inherited syntax
            Expect(2 + 2, EqualTo(4));
            Expect(2 + 2 == 4);
            Expect(i3, EqualTo(d3));
            Expect(2 + 2, Not.EqualTo(5));
            Expect(i3, Not.EqualTo(iunequal));
        }

17. Example

Project: grisu.net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

18. Example

View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

19. Example

View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

20. Example

View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

21. Example

View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}

22. Example

View license
[Test]
		public void EqualityTests()
		{
			int[] i3 = new int[] { 1, 2, 3 };
			double[] d3 = new double[] { 1.0, 2.0, 3.0 };
			int[] iunequal = new int[] { 1, 3, 2 };

			// Classic Syntax
			Assert.AreEqual(4, 2 + 2);
			Assert.AreEqual(i3, d3);
			Assert.AreNotEqual(5, 2 + 2);
			Assert.AreNotEqual(i3, iunequal);

			// Helper syntax
			Assert.That(2 + 2, Is.EqualTo(4));
			Assert.That(2 + 2 == 4);
			Assert.That(i3, Is.EqualTo(d3));
			Assert.That(2 + 2, Is.Not.EqualTo(5));
			Assert.That(i3, Is.Not.EqualTo(iunequal));
		
			// Inherited syntax
			Expect(2 + 2, EqualTo(4));
			Expect(2 + 2 == 4);
			Expect(i3, EqualTo(d3));
			Expect(2 + 2, Not.EqualTo(5));
			Expect(i3, Not.EqualTo(iunequal));
		}