NUnit.Framework.Assert.IsInstanceOfType(System.Type, object, string)

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

6 Examples 7

1. Example

View license
public static void IsInstanceOfType(object obj, Type type)
        {
#pragma warning disable 612
            NUnit.Framework.Assert.IsInstanceOfType(type, obj, null);
#pragma warning restore 612
        }

2. Example

View license
public static void IsInstanceOfType(object obj, Type type, string message)
        {
#pragma warning disable 612
            NUnit.Framework.Assert.IsInstanceOfType(type, obj, message);
#pragma warning restore 612
        }

3. Example

Project: keepassrpc
Source File: TestImportContext.cs
View license
private static void AssertInStock(Type expected, Type type)
        {
            ImportContext context = new ImportContext();
            IImporter importer = context.FindImporter(type);
            Assert.IsNotNull(importer, "No importer found for {0}", type.FullName);
            Assert.IsInstanceOfType(expected, importer, type.FullName);
        }

4. Example

Project: keepassrpc
Source File: TestExportContext.cs
View license
private static void AssertInStock(Type expected, Type type)
        {
            ExportContext context = new ExportContext();
            IExporter exporter = context.FindExporter(type);
            Assert.IsNotNull(exporter, "No exporter found for {0}", type.FullName);
            Assert.AreSame(type, exporter.InputType, "{0} reported {1} when expecting {2}.", exporter, exporter.InputType, type);
            Assert.IsInstanceOfType(expected, exporter, type.FullName);
        }

5. Example

Project: 32feet
Source File: SocketBehaviour.cs
View license
public static void TestClose()
    {
        TcpClient cli;
        //
        cli = new TcpClient();
        cli.Connect("www.microsoft.com", 80);
        Stream strm = cli.GetStream();
        byte[] get = Encoding.ASCII.GetBytes("GET / HTTP/1.0\r\nHost: www.microsoft.com\r\nConnection: Close\r\n\r\n");
        strm.Write(get, 0, get.Length);
        Thread.Sleep(5000);
        strm.Close();
        byte[] buf = new byte[1000];
        try {
            strm.Read(buf, 0, buf.Length);
            Assert.Fail("SHaT!");
        } catch (Exception ex) {
            Assert.IsInstanceOfType(typeof(ObjectDisposedException), ex, "ObjectDisposedException");
        }
        try {
            strm.Write(buf, 0, buf.Length);
            Assert.Fail("SHaT!");
        } catch (Exception ex) {
            Assert.IsInstanceOfType(typeof(ObjectDisposedException), ex, "ObjectDisposedException");
        }
    }

6. Example

Project: 32feet
Source File: SocketBehaviour.cs
View license
public static void TestConnect()
    {
        IAsyncResult ar1, ar2;
        TcpClient cli;
       /n ..... /n //View Source file for more details /n }