NUnit.Framework.Assert.IsNotInstanceOf(object)

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

28 Examples 7

1. Example

View license
public static void ShouldNotBeOfType<T>(this object actual) where T : class
		{
			Assert.IsNotInstanceOf<T>(actual);
		}

2. Example

View license
public static void ShouldNotBeOfType<T>(this object actual) where T : class
		{
			Assert.IsNotInstanceOf<T>(actual);
		}

3. Example

Project: Dominion
Source File: SpecificationExtensions.cs
View license
public static void ShouldNotBeOfType<T>(this object actual, Type expected)
        {
            Assert.IsNotInstanceOf<T>(actual);
        }

4. Example

Project: Dominion
Source File: SpecificationExtensions.cs
View license
public static void ShouldNotBeOfType<T>(this object actual, Type expected)
        {
            Assert.IsNotInstanceOf<T>(actual);
        }

5. Example

Project: MvcFlash
Source File: DynamicHelpersTests.cs
View license
[Test]
        public void Does_Not_Try_And_Convert_Non_Anonymous_Objects()
        {
            const string target = "hello";
            var result = DynamicHelpers.IfAnonymousCovertToExpando(target);

            Assert.IsNotInstanceOf<ExpandoObject>(target);
            Assert.AreSame(target, result);
        }

6. Example

Project: UnityIO
Source File: FileChangesTests.cs
View license
[Test]
    [Description("Tests to see if we can duplicate a file")]
    public void DuplicateFile()
    {
        // Get our file
        IFile cube = m_WorkingDirectroy.GetFiles("*Cube*").FirstOrDefault();
        // Should not be null;
        Assert.IsNotInstanceOf<NullFile>(cube);
        // Duplicate our prefab
        var secondCube = cube.Duplicate();
        // Check if our first one still exists
        Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(cube.path));
        // And our second one is alive.
        Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(secondCube.path));
    }

7. Example

Project: UnityIO
Source File: FileChangesTests.cs
View license
[Test]
    [Description("Tests to see if we can duplicate a file and give it a new name")]
    public void DuplicateFileWithNewName()
    {
        // Get our file
        IFile cube = m_WorkingDirectroy.GetFiles("*Cube*").FirstOrDefault();
        // Should not be null;
        Assert.IsNotInstanceOf<NullFile>(cube);
        // Duplicate our prefab
        var secondCube = cube.Duplicate("Super Box");
        // Check if our first one still exists
        Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(m_WorkingDirectroy.path + "/Cube.prefab"));
        // And our second one is alive.
        Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(m_WorkingDirectroy.path + "/Super Box.prefab"));
    }

8. Example

View license
[Test]
        public void ClearsConnection()
        {
            var adapter = new AdoAdapter(new StubConnectionProvider());
            adapter.SetConnectionModifier(c => new FooConnection(c));
            Assert.IsInstanceOf<FooConnection>(adapter.CreateConnection());
            adapter.ClearConnectionModifier();
            Assert.IsNotInstanceOf<FooConnection>(adapter.CreateConnection());
        }

9. Example

Project: symbooglix
Source File: TypeCtor.cs
View license
[Test(),ExpectedException(typeof(NotSupportedException))]
        public void Arguments()
        {
            var tcDecl = new TypeCtorDecl(Token.NoToken, "fox", 1);
            var tc = new CtorType(Token.NoToken, tcDecl, new List <Microsoft.Boogie.Type>() { Microsoft.Boogie.Type.Bool});
            var tcTypeIdent = new TypedIdent(Token.NoToken, "fox", tc);
            var gv = new GlobalVariable(Token.NoToken, tcTypeIdent);

            // FIXME: The Symbolic constructor shouldn't really need the program location
            gv.SetMetadata<ProgramLocation>((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(gv));
            var sym = new SymbolicVariable("y", gv);

            var builder = new SimpleExprBuilder(/*immutable=*/ true);
            var eq = builder.Eq(sym.Expr, sym.Expr);
            Assert.IsNotInstanceOf<LiteralExpr>(eq); // Check that it wasn't constant folded

            using (var writer = new StringWriter())
            {
                var printer = GetPrinter(writer);
                printer.AddDeclarations(eq);
                printer.PrintSortDeclarations();
                Assert.AreEqual("(declare-sort @fox)\n", writer.ToString());
            }
        }

10. Example

Project: spring-net
Source File: IsAopProxyTests.cs
View license
[Test]
        public void IsCompositionProxy()
        {
            var pf = new ProxyFactory(typeof(ITestObject), new DebugAdvice());
            pf.Target = _target;
            Assert.False(pf.ProxyTargetType);

            var proxy = (ITestObject)pf.GetProxy();

            Assert.True(AopUtils.IsCompositionAopProxy(proxy));
            Assert.True(AopUtils.IsAopProxy(proxy));
            Assert.IsNotInstanceOf<TestObject>(proxy);
        }

11. Example

Project: UnityIO
Source File: FileChangesTests.cs
View license
[Test]
    [Description("Tests to see if a file can be renamed.")]
    public void RenameFile()
    {
        // Get our file
        IFile cube = m_WorkingDirectroy.GetFiles("*Cylinder*").FirstOrDefault();
        // Should not be null;
        Assert.IsNotInstanceOf<NullFile>(cube);
        // Duplicate our prefab
        cube.Rename("Super Tube");
        // Check to make sure the original item does not exist
        Assert.IsNull(AssetDatabase.LoadAssetAtPath<GameObject>(m_WorkingDirectroy.path + "/Cylinder.prefab"), "Our old prefab still exists");
        // Check if the rename happened.
        Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(m_WorkingDirectroy.path + "/Super Tube.prefab"), "The renamed prefab could not be found");
    }

12. Example

Project: AngleSharp
Source File: DOM.cs
View license
[Test]
        public void CreateTimeElementIsNotUnknown()
        {
            var document = ("").ToHtmlDocument();
            var time = document.CreateElement("time");
            Assert.AreEqual("TIME", time.TagName);
            Assert.IsInstanceOf<IHtmlElement>(time);
            Assert.IsNotInstanceOf<IHtmlUnknownElement>(time);
        }

13. Example

Project: AngleSharp
Source File: DOM.cs
View license
[Test]
        public void CreateBdoElementIsNotUnknown()
        {
            var document = ("").ToHtmlDocument();
            var bdo = document.CreateElement("bdo");
            Assert.AreEqual("BDO", bdo.TagName);
            Assert.IsInstanceOf<IHtmlElement>(bdo);
            Assert.IsNotInstanceOf<IHtmlUnknownElement>(bdo);
        }

14. Example

Project: AngleSharp
Source File: DOM.cs
View license
[Test]
        public void CreateProgressElementIsNotUnknown()
        {
            var document = ("").ToHtmlDocument();
            var progress = document.CreateElement("progress");
            Assert.AreEqual("PROGRESS", progress.TagName);
            Assert.IsInstanceOf<IHtmlElement>(progress);
            Assert.IsNotInstanceOf<IHtmlUnknownElement>(progress);
        }

15. Example

Project: AngleSharp
Source File: DOM.cs
View license
[Test]
        public void CreateMarkElementIsNotUnknown()
        {
            var document = ("").ToHtmlDocument();
            var mark = document.CreateElement("mark");
            Assert.AreEqual("MARK", mark.TagName);
            Assert.IsInstanceOf<IHtmlElement>(mark);
            Assert.IsNotInstanceOf<IHtmlUnknownElement>(mark);
        }

16. Example

Project: AngleSharp
Source File: DOM.cs
View license
[Test]
        public void CreateDefineElementIsNotUnknown()
        {
            var document = ("").ToHtmlDocument();
            var dfn = document.CreateElement("dfn");
            Assert.AreEqual("DFN", dfn.TagName);
            Assert.IsInstanceOf<IHtmlElement>(dfn);
            Assert.IsNotInstanceOf<IHtmlUnknownElement>(dfn);
        }

17. Example

Project: AngleSharp
Source File: DOM.cs
View license
[Test]
        public void CreateKeyboardElementIsNotUnknown()
        {
            var document = ("").ToHtmlDocument();
            var kbd = document.CreateElement("kbd");
            Assert.AreEqual("KBD", kbd.TagName);
            Assert.IsInstanceOf<IHtmlElement>(kbd);
            Assert.IsNotInstanceOf<IHtmlUnknownElement>(kbd);
        }

18. Example

Project: AngleSharp
Source File: DOM.cs
View license
[Test]
        public void CreateSpanElementIsNotUnknown()
        {
            var document = ("").ToHtmlDocument();
            var span = document.CreateElement("span");
            Assert.AreEqual("SPAN", span.TagName);
            Assert.IsInstanceOf<IHtmlElement>(span);
            Assert.IsNotInstanceOf<IHtmlUnknownElement>(span);
        }

19. Example

Project: UnityIO
Source File: FileChangesTests.cs
View license
[Test]
    [Description("Tests to see if a file can be moved.")]
    public void MoveFile()
    {
        // Create directory to move stuff into.
        var moveTo = m_WorkingDirectroy.CreateDirectory("MoveTo");
        // Get our file
        IFile cube = m_WorkingDirectroy.GetFiles("*Plane*").FirstOrDefault();
        // Should not be null;
        Assert.IsNotInstanceOf<NullFile>(cube);
        // Duplicate our prefab
        cube.Move(moveTo.path);
        // Check to make sure the original item does not exist
        Assert.IsNull(AssetDatabase.LoadAssetAtPath<GameObject>(m_WorkingDirectroy.path + "/Plane.prefab"), "Our old prefab still exists");
        // Check if the rename happened.
        Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(m_WorkingDirectroy.path + "/MoveTo/Plane.prefab"), "The renamed prefab could not be found");
    }

20. Example

View license
[Test]
        public void GetConverterTest()
        {
            Assert.IsInstanceOf<EnumStringValueTypeConverter>(TypeDescriptor.GetConverter(MockEnum.TestA));
            Assert.IsInstanceOf<EnumStringValueTypeConverter>(TypeDescriptor.GetConverter(MockEnum.TestB));
            Assert.IsInstanceOf<EnumStringValueTypeConverter>(TypeDescriptor.GetConverter(MockEnum.TestC));

            MockEnum? nullable = MockEnum.TestA;
            Assert.IsInstanceOf<EnumStringValueTypeConverter>(TypeDescriptor.GetConverter(nullable));

            Assert.IsNotInstanceOf<EnumStringValueTypeConverter>(TypeDescriptor.GetConverter(ConsoleColor.Blue));
            Assert.IsNotInstanceOf<EnumStringValueTypeConverter>(TypeDescriptor.GetConverter(42));
            Assert.IsNotInstanceOf<EnumStringValueTypeConverter>(TypeDescriptor.GetConverter("test"));
        }

21. Example

View license
[Test]
        public void NotReturnAViewResult_WhenAnExcelFileIsUploaded_NewFormat()
        {
            var file = Substitute.For<HttpPostedFileBase>();
            file.ContentLength.Returns(NonZeroFileLength);
            file.FileName.Returns("A new-format Excel file.xlsx");

            var result = controller.ImportAsync(file);

            Assert.IsNotInstanceOf<ViewResult>(result);
        }

22. Example

Project: symbooglix
Source File: TypeCtor.cs
View license
[Test()]
        public void NoArguments()
        {
            var tcDecl = new TypeCtorDecl(Token.NoToken, "fox", 0);
            var tc = new CtorType(Token.NoToken, tcDecl, new List <Microsoft.Boogie.Type>());
            var tcTypeIdent = new TypedIdent(Token.NoToken, "fox", tc);
            var gv = new GlobalVariable(Token.NoToken, tcTypeIdent);

            // FIXME: The Symbolic constructor shouldn't really need the program location
            gv.SetMetadata<ProgramLocation>((int) AnnotationIndex.PROGRAM_LOCATION, new ProgramLocation(gv));
            var sym = new SymbolicVariable("y", gv);

            var builder = new SimpleExprBuilder(/*immutable=*/ true);
            var eq = builder.Eq(sym.Expr, sym.Expr);
            Assert.IsNotInstanceOf<LiteralExpr>(eq); // Check that it wasn't constant folded

            using (var writer = new StringWriter())
            {
                var printer = GetPrinter(writer);
                printer.AddDeclarations(eq);
                printer.PrintSortDeclarations();
                Assert.AreEqual("(declare-sort @fox)", writer.ToString().Trim());
            }
        }

23. 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");
        }

24. Example

View license
[Test]
        public void NotReturnAViewResult_WhenAnExcelFileIsUploaded_OldFormat()
        {
            var file = Substitute.For<HttpPostedFileBase>();
            file.ContentLength.Returns(NonZeroFileLength);
            file.FileName.Returns("An old-format Excel file.xls");

            var result = controller.ImportAsync(file);

            Assert.IsNotInstanceOf<ViewResult>(result);
        }

25. Example

Project: symbooglix
Source File: TypeCtor.cs
View license
[Test ()]
        public void MapWithTypeConstructorTypesNoArguments()
        {
            var tcD/n ..... /n //View Source file for more details /n }

26. Example

View license
[Test]
        public async void TestSendAndReceiveExceptions()
        {
            var resolver =/n ..... /n //View Source file for more details /n }

27. Example

View license
[Test]
        public async void TestSendAndReceiveExceptions()
        {
            var resolver =/n ..... /n //View Source file for more details /n }

28. Example

Project: Stylet
Source File: StyletIoCAutobindingTests.cs
View license
[Test]
        public void IgnoresAllImplementsWhichIsNotPossible()
        {
            var builder = new StyletIoCBuilder();
            builder.Bind<I1>().ToAllImplementations();
            var ioc = builder.BuildContainer();

            var result = ioc.GetAll<I1>().ToList();
            Assert.AreEqual(2, result.Count);
            Assert.IsNotInstanceOf<C13>(result[0]);
            Assert.IsNotInstanceOf<C13>(result[1]);
        }