NUnit.Framework.Assert.IsNotInstanceOf(System.Type, object)

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

26 Examples 7

1. Example

Project: AutoTest.Net
Source File: TypeAssertTest.cs
View license
[Test]
		public void IsNotInstanceOf()
		{
			Assert.IsNotInstanceOf(typeof(System.Int32), "abc123" );
			Expect( "abc123", Not.InstanceOf(typeof(System.Int32)) );
#if NET_2_0
			Assert.IsNotInstanceOf<System.Int32>("abc123");
#endif
		}

2. Example

Project: AutoTest.Net
Source File: TypeAssertTest.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
		public void IsNotInstanceOfFails()
		{
			expectedMessage =
				"  Expected: not instance of <System.Exception>" + System.Environment.NewLine + 
				"  But was:  <System.ApplicationException>" + System.Environment.NewLine;
			Assert.IsNotInstanceOf( typeof(System.Exception), new ApplicationException() );
		}

3. Example

Project: AutoTest.Net
Source File: TypeAssertTest.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
		public void IsNotInstanceOfFails()
		{
			expectedMessage =
				"  Expected: not instance of <System.Exception>" + System.Environment.NewLine + 
				"  But was:  <System.ApplicationException>" + System.Environment.NewLine;
			Assert.IsNotInstanceOf( typeof(System.Exception), new ApplicationException() );
		}

4. Example

View license
public static void ShouldNotBeOfType(this object actual, Type expected)
    {
        Assert.IsNotInstanceOf(expected, actual);
    }

5. Example

Project: AutoTest.Net
Source File: TypeAssertTest.cs
View license
[Test]
		public void IsNotInstanceOf()
		{
			Assert.IsNotInstanceOf(typeof(System.Int32), "abc123" );
			Expect( "abc123", Not.InstanceOf(typeof(System.Int32)) );
#if CLR_2_0 || CLR_4_0
            Assert.IsNotInstanceOf<System.Int32>("abc123");
#endif
		}

6. Example

Project: AutoTest.Net
Source File: TypeAssertTest.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
		public void IsNotInstanceOfFails()
		{
			expectedMessage =
				"  Expected: not instance of <System.Exception>" + System.Environment.NewLine + 
				"  But was:  <System.ApplicationException>" + System.Environment.NewLine;
			Assert.IsNotInstanceOf( typeof(System.Exception), new ApplicationException() );
		}

7. Example

Project: ContinuousTests
Source File: TypeAssertTest.cs
View license
[Test]
		public void IsNotInstanceOf()
		{
			Assert.IsNotInstanceOf(typeof(System.Int32), "abc123" );
			Expect( "abc123", Not.InstanceOf(typeof(System.Int32)) );
#if CLR_2_0 || CLR_4_0
            Assert.IsNotInstanceOf<System.Int32>("abc123");
#endif
		}

8. Example

Project: ContinuousTests
Source File: TypeAssertTest.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
		public void IsNotInstanceOfFails()
		{
			expectedMessage =
				"  Expected: not instance of <System.Exception>" + System.Environment.NewLine + 
				"  But was:  <System.ApplicationException>" + System.Environment.NewLine;
			Assert.IsNotInstanceOf( typeof(System.Exception), new ApplicationException() );
		}

9. Example

Project: ContinuousTests
Source File: TypeAssertTest.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
		public void IsNotInstanceOfFails()
		{
			expectedMessage =
				"  Expected: not instance of <System.Exception>" + System.Environment.NewLine + 
				"  But was:  <System.ApplicationException>" + System.Environment.NewLine;
			Assert.IsNotInstanceOf( typeof(System.Exception), new ApplicationException() );
		}

10. Example

Project: ContinuousTests
Source File: TypeAssertTest.cs
View license
[Test]
		public void IsNotInstanceOf()
		{
			Assert.IsNotInstanceOf(typeof(System.Int32), "abc123" );
			Expect( "abc123", Not.InstanceOf(typeof(System.Int32)) );
#if NET_2_0
			Assert.IsNotInstanceOf<System.Int32>("abc123");
#endif
		}

11. Example

Project: AutoTest.Net
Source File: TypeAssertTest.cs
View license
[Test]
		public void IsNotInstanceOf()
		{
			Assert.IsNotInstanceOf(typeof(System.Int32), "abc123" );
			Expect( "abc123", Not.InstanceOf(typeof(System.Int32)) );
#if NET_2_0
			Assert.IsNotInstanceOf<System.Int32>("abc123");
#endif
		}

12. Example

Project: ContinuousTests
Source File: TypeAssertTest.cs
View license
[Test,ExpectedException(typeof(AssertionException))]
		public void IsNotInstanceOfFails()
		{
			expectedMessage =
				"  Expected: not instance of <System.Exception>" + System.Environment.NewLine + 
				"  But was:  <System.ApplicationException>" + System.Environment.NewLine;
			Assert.IsNotInstanceOf( typeof(System.Exception), new ApplicationException() );
		}

13. Example

Project: ContinuousTests
Source File: TypeAssertTest.cs
View license
[Test]
		public void IsNotInstanceOf()
		{
			Assert.IsNotInstanceOf(typeof(System.Int32), "abc123" );
			Expect( "abc123", Not.InstanceOf(typeof(System.Int32)) );
#if NET_2_0
			Assert.IsNotInstanceOf<System.Int32>("abc123");
#endif
		}

14. Example

Project: nunit
Source File: TypeAssertTest.cs
View license
[Test]
        public void IsNotInstanceOf()
        {
            Assert.IsNotInstanceOf(typeof(System.Int32), "abc123" );
            Assert.That( "abc123", Is.Not.InstanceOf(typeof(System.Int32)) );
            Assert.IsNotInstanceOf<System.Int32>("abc123");
        }

15. Example

Project: nunit
Source File: TypeAssertTest.cs
View license
[Test]
        public void IsNotInstanceOfFails()
        {
            var expectedMessage =
                "  Expected: not instance of <System.Exception>" + System.Environment.NewLine + 
                "  But was:  <System.ArgumentException>" + System.Environment.NewLine;
            var ex = Assert.Throws<AssertionException>(() => Assert.IsNotInstanceOf( typeof(System.Exception), new ArgumentException() ));
            Assert.That(ex.Message, Is.EqualTo(expectedMessage));
        }

16. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

17. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

18. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

19. Example

Project: Pash
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

20. Example

View license
[Test]
        public void InstanceOfTests()
        {
            // Classic syntax
            Assert.IsInstanceOf(typeof(string), "Hello");
            Assert.IsNotInstanceOf(typeof(string), 5);

            // Constraint Syntax
            Assert.That("Hello", Is.InstanceOf(typeof(string)));
            Assert.That(5, Is.Not.InstanceOf(typeof(string)));

            // Inherited syntax
            Expect("Hello", InstanceOf(typeof(string)));
            Expect(5, Not.InstanceOf(typeof(string)));
        }

21. Example

Project: grisu.net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

22. Example

View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

23. Example

View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

24. Example

View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

25. Example

View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}

26. Example

View license
[Test]
		public void InstanceOfTypeTests()
		{
			// Classic syntax
			Assert.IsInstanceOf(typeof(string), "Hello");
			Assert.IsNotInstanceOf(typeof(string), 5);

			// Helper syntax
			Assert.That("Hello", Is.InstanceOf(typeof(string)));
			Assert.That(5, Is.Not.InstanceOf(typeof(string)));

			// Inherited syntax
			Expect("Hello", InstanceOf(typeof(string)));
			Expect(5, Not.InstanceOf(typeof(string)));
		}