NUnit.Framework.Assert.Throws(NUnit.Framework.TestDelegate, string, params object[])

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

10 Examples 7

1. Example

Project: iOS4Unity
Source File: Assert.cs
View license
public static T Throws<T>(TestDelegate code) where T : Exception
        {
            return Throws<T>(code, string.Empty, null);
        }

2. Example

Project: iOS4Unity
Source File: Assert.cs
View license
public static T Throws<T>(TestDelegate code, string message) where T : Exception
        {
            return Throws<T>(code, message, null);
        }

3. Example

Project: msgpack-cli
Source File: Assert.Exceptions.cs
View license
public static TActual Throws<TActual>(TestDelegate code) where TActual : Exception
        {
            return Throws<TActual>(code, string.Empty, null);
        }

4. Example

Project: nunit
Source File: Assert.Exceptions.cs
View license
public static TActual Throws<TActual>(TestDelegate code) where TActual : Exception
        {
            return Throws<TActual>(code, string.Empty, null);
        }

5. Example

Project: nunit-unity3d
Source File: Assert.cs
View license
public static T Throws<T>(TestDelegate code) where T : Exception
        {
            return Throws<T>(code, string.Empty, null);
        }

6. Example

Project: nunit-unity3d
Source File: Assert.cs
View license
public static T Throws<T>(TestDelegate code, string message) where T : Exception
        {
            return Throws<T>(code, message, null);
        }

7. Example

Project: Prig
Source File: LooseCrossDomainAssert.cs
View license
public new static TException Throws<TException>(TestDelegate code, string message, params object[] args) where TException : Exception
        {
            try
            {
                code();
            }
            catch (Exception ex)
            {
                if (!LooseCrossDomainAccessor.IsTypeOf(ex, typeof(TException)))
                    return NUnit.Framework.Assert.Throws<TException>(code, message, args);

                return ex as TException;
            }

            throw new AssertionException("");  // avoid build failure(you will never get here).
        }

8. Example

Project: MimeKit
Source File: ArgumentExceptionTests.cs
View license
static void AssertParseArguments (Type type)
		{
			const string text = "this is a dummy text buffer/n ..... /n //View Source file for more details /n }

9. Example

Project: MimeKit
Source File: ArgumentExceptionTests.cs
View license
static void AssertFilterArguments (IMimeFilter filter)
		{
			int outputIndex, outputLength;
			var /n ..... /n //View Source file for more details /n }

10. Example

Project: MimeKit
Source File: ArgumentExceptionTests.cs
View license
static void AssertStreamArguments (Stream stream)
		{
			var buffer = new byte[1024];
			ArgumentExc/n ..... /n //View Source file for more details /n }