NUnit.Framework.Assert.IsNull(object, string)

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

183 Examples 7

1. Example

View license
[Test]
		public void DefaultValues ()
		{
			var i = new XamlTypeInvoker (new XamlType (typeof (object), sctx));
			Assert.IsNull (i.SetMarkupExtensionHandler, "#1");
			Assert.IsNull (i.SetTypeConverterHandler, "#2");
		}

2. Example

View license
[Test]
		public void ConstructorNullArg ()
		{
			// allowed.
			var ex = new XamlDuplicateMemberException ((XamlMember) null, (XamlType) null);
			Assert.IsNull (ex.DuplicateMember, "#1");
			Assert.IsNull (ex.ParentType, "#2");
		}

3. Example

Project: Portable.Xaml
Source File: XamlDirectiveTest.cs
View license
[Test]
		public void ConstructorNameNull ()
		{
			// wow, it is allowed.
			var d = new XamlDirective (String.Empty, null);
			Assert.IsNull (d.Name, "#1");
		}

4. Example

Project: Portable.Xaml
Source File: XamlDeferLoadTest.cs
View license
[Test]
		public void TypeNameShouldNotSetType()
		{
			var attr = new XamlDeferLoadAttribute(typeof(TestDeferredLoader).AssemblyQualifiedName, typeof(DeferredLoadingChild).AssemblyQualifiedName);
			Assert.IsNull(attr.LoaderType, "#1");
			Assert.IsNull(attr.ContentType, "#2");
		}

5. Example

View license
[Test]
		public void CustomTypeDefaultValues ()
		{
			var i = new MyXamlMemberInvoker ();
			Assert.IsNull (i.UnderlyingGetter, "#1");
			Assert.IsNull (i.UnderlyingSetter, "#2");
		}

6. Example

View license
[Test]
		public void UnknownInvoker ()
		{
			Assert.IsNull (XamlMemberInvoker.UnknownInvoker.UnderlyingGetter, "#1");
			Assert.IsNull (XamlMemberInvoker.UnknownInvoker.UnderlyingSetter, "#2");
		}

7. Example

View license
[Test]
        public void GetValue_ValueList_NameDoesNotExist_NullList()
        {

            // The GetValue function should work even if
            // the potential value list is null.

            vCardSubpropertyCollection subs =
                new vCardSubpropertyCollection();

            string value =
                subs.GetValue("NAME", (string[])null);

            Assert.IsNull(
                value,
                "The value should be null.");

        }

8. Example

View license
[Test]
        public void GetValue_Name_ValueDoesNotExist()
        {

            vCardSubpropertyCollection subs =
                new vCardSubpropertyCollection();

            string value1 = subs.GetValue("NAME");

            Assert.IsNull(
                value1,
                "A null value should have been returned.");

        }

9. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertNull(string message, Object anObject) 
		{
			NUnit.Framework.Assert.IsNull(anObject, message);
		}

10. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertNull(Object anObject) 
		{
			NUnit.Framework.Assert.IsNull(anObject, string.Empty);
		}

11. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertNull(Object anObject) 
		{
			NUnit.Framework.Assert.IsNull(anObject, string.Empty);
		}

12. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertNull(string message, Object anObject) 
		{
			NUnit.Framework.Assert.IsNull(anObject, message);
		}

13. Example

Project: DReAM
Source File: XUriMapTests.cs
View license
[Test]
        public void Schemes_should_be_differentiated() {
            XUriMap<string> map = new XUriMap<string>();
            map[new XUri("test1://foo/bar/boo")] = "t1/foo/bar";
            map[new XUri("test2://foo/bar/baz")] = "t2/foo/bar";
            string match;
            int similarity;
            map.TryGetValue(new XUri("test2://foo/bar/boo"), out match, out similarity);
            Assert.IsNull(match,match);
        }

14. Example

View license
public static void IsNull<T>(this T value, string message = "")
        {
            Assert.IsNull(value, message);
        }

15. Example

Project: hbm-to-fnh
Source File: AssertExtensions.cs
View license
public static void ShouldBeNull<T>(this T item, [NotNull] string errorMessage) where T : class
		{
			Assert.IsNull(item, errorMessage);
		}

16. Example

View license
public static void IsNull<T>(this T value, string message = "")
        {
            Assert.IsNull(value, message);
        }

17. Example

Project: SmartStoreNET
Source File: TestExtensions.cs
View license
public static T ShouldNotNull<T>(this T obj, string message)
        {
            Assert.IsNull(obj, message);
            return obj;
        }

18. Example

Project: spring-net
Source File: NUnitAdapter.cs
View license
public static void AssertNull(string message, object o)
		{
			Assert.IsNull(o, message);
		}

19. Example

Project: spring-net
Source File: TypeRegistryTests.cs
View license
[Test]
		public void ReturnsNullIfNoTypeAliasRegistered()
		{
			Type type = TypeRegistry.ResolveType("panko");
			Assert.IsNull(type, "Must return null if no Type is registered under the supplied alias.");
		}

20. Example

Project: yacq
Source File: ChainingAssertion.NUnit.cs
View license
public static void IsNull<T>(this T value, string message = "")
        {
            Assert.IsNull(value, message);
        }

21. Example

Project: riak-dotnet-client
Source File: Extensions.cs
View license
public static void ShouldBeNull<T>(this T obj, string message = null) where T : class
        {
            Assert.IsNull(obj, message);
        }

22. Example

View license
public static void ShouldBeNull(this object obj, string message)
        {
            Assert.IsNull(obj, message);
        }

23. Example

View license
[Test]
		public void ObjectType ()
		{
			// This test asserts that XamlLanguage.Object.TypeConverter.ConverterType is null for different reason.
			var c = new XamlValueConverter<TypeConverter> (typeof (TypeConverter), XamlLanguage.Object, null);
			Assert.IsNotNull (c.ConverterInstance, "#1");
			Assert.IsNull (XamlLanguage.Object.TypeConverter.ConverterInstance, "#2");
		}

24. Example

View license
[Test]
		public void DefaultValues ()
		{
			var s = new XamlReaderSettings ();
			Assert.IsFalse (s.AllowProtectedMembersOnRoot, "#1");
			Assert.IsNull (s.BaseUri, "#2");
			Assert.IsFalse (s.IgnoreUidsOnPropertyElements, "#3");
			Assert.IsNull (s.LocalAssembly, "#4");
			Assert.IsFalse (s.ProvideLineInfo, "#5");
			Assert.IsFalse (s.ValuesMustBeString, "#6");
		}

25. Example

View license
[Test]
		public void UnknownInvokerGetEnumeratorMethod ()
		{
			try {
				Assert.IsNull (XamlTypeInvoker.UnknownInvoker.GetEnumeratorMethod (), "#1");
			} catch (Exception) {
				// .NET is buggy, returns NRE.
			}
		}

26. Example

Project: Portable.Xaml
Source File: XamlReaderTestBase.cs
View license
protected void Read_CommonXamlType (XamlObjectReader r)
		{
			Read_CommonXamlType (r, delegate {
				Assert.IsNull (r.Instance, "ct#4");
				});
		}

27. Example

View license
[Test]
		public void DefaultValues()
		{
			var s = new XamlXmlReaderSettings();
			Assert.IsFalse(s.CloseInput, "#1");
			Assert.IsFalse(s.SkipXmlCompatibilityProcessing, "#2");
			Assert.IsNull(s.XmlLang, "#3");
			Assert.IsFalse(s.XmlSpacePreserve, "#4");
		}

28. Example

View license
[Test]
		public void DefaultValues ()
		{
			var s = new XamlObjectReaderSettings ();
			Assert.IsFalse (s.RequireExplicitContentVisibility, "#1");

			Assert.IsFalse (s.AllowProtectedMembersOnRoot, "#2");
			Assert.IsFalse (s.IgnoreUidsOnPropertyElements, "#3");
			Assert.IsFalse (s.ProvideLineInfo, "#4");
			Assert.IsFalse (s.ValuesMustBeString, "#5");
			Assert.IsNull (s.BaseUri, "#6");
			Assert.IsNull (s.LocalAssembly, "#7");
		}

29. Example

Project: Portable.Xaml
Source File: XamlTypeTest.cs
View license
[Test]
		public void GetPositionalParametersWrongCount ()
		{
			Assert.IsNull (XamlLanguage.Type.GetPositionalParameters (2), "#1");
		}

30. Example

View license
[Test]
		public void UnknownInvoker ()
		{
			Assert.IsNull (XamlTypeInvoker.UnknownInvoker.SetMarkupExtensionHandler, "#1");
			Assert.IsNull (XamlTypeInvoker.UnknownInvoker.SetTypeConverterHandler, "#2");
			Assert.IsNull (XamlTypeInvoker.UnknownInvoker.GetAddMethod (XamlLanguage.Object), "#3");
		}

31. Example

Project: Portable.Xaml
Source File: XDataTest.cs
View license
[Test]
		public void GetXmlReaderWithNullText ()
		{
			var x = new XData ();
			Assert.IsNull (x.Text, "#1");
			Assert.Throws<ArgumentNullException> (() => { var xr = x.XmlReader; }, "#2");
		}

32. Example

View license
[Test]
		public void DefaultValues ()
		{
			var s = new XamlObjectWriterSettings ();
			// TODO: Assert.IsNull (s.AccessLevel, "#1");
			Assert.IsNull (s.AfterBeginInitHandler, "#2");
			Assert.IsNull (s.AfterEndInitHandler, "#3");
			Assert.IsNull (s.AfterPropertiesHandler, "#4");
			Assert.IsNull (s.BeforePropertiesHandler, "#5");
			Assert.IsNull (s.ExternalNameScope, "#6");
			Assert.IsFalse (s.IgnoreCanConvert, "#7");
			Assert.IsFalse (s.PreferUnconvertedDictionaryKeys, "#8");
			Assert.IsFalse (s.RegisterNamesOnExternalNamescope, "#9");
			Assert.IsNull (s.RootObjectInstance, "#10");
			Assert.IsFalse (s.SkipDuplicatePropertyCheck, "#11");
			Assert.IsFalse (s.SkipProvideValueOnRoot, "#12");
			Assert.IsNull (s.XamlSetValueHandler, "#13");
		}

33. Example

Project: Portable.Xaml
Source File: XamlTypeTest.cs
View license
[Test]
		public void GetAliasedPropertyOnAllTypes ()
		{
			foreach (var xt in XamlLanguage.AllTypes)
				foreach (var xd in XamlLanguage.AllDirectives)
					Assert.IsNull (xt.GetAliasedProperty (xd), xt.Name + " and " + xd.Name);
		}

34. Example

View license
[Test]
		public void WriteNullMemberAsObject ()
		{
			var r = new XamlObjectReader (new TestClass4 ());
			WriteNullMemberAsObject (r, delegate {
				Assert.IsNull (r.Instance, "#x");
			}
			);
		}

35. Example

View license
[Test]
		public void ConstructorNullAssemblies ()
		{
			// allowed.
			var ctx = new XamlSchemaContext ((Assembly []) null);
			Assert.IsFalse (ctx.FullyQualifyAssemblyNamesInClrNamespaces, "#1");
			Assert.IsFalse (ctx.SupportMarkupExtensionsWithDuplicateArity, "#2");
			Assert.IsNull (ctx.ReferenceAssemblies, "#3");
		}

36. Example

Project: Portable.Xaml
Source File: XDataTest.cs
View license
[Test]
		public void SetXmlReader ()
		{
			var x = new XData ();
			x.XmlReader = XmlReader.Create (new StringReader ("<root/>"));
			Assert.IsNull (x.Text, "#1");
			Assert.IsNotNull (x.XmlReader, "#2");
			x.XmlReader = null;
		}

37. Example

Project: Portable.Xaml
Source File: XamlLanguageTest.cs
View license
[Test]
		public void Object ()
		{
			var t = XamlLanguage.Object;
			TestXamlTypePrimitive (t, "Object", typeof (object), true, false);
			Assert.IsNull (t.BaseType, "#x1");

			/* Those properties are pointless regarding practical use. Those "members" does not participate in serialization.
			var l = t.GetAllAttachableMembers ().ToArray ();
			Assert.AreEqual (0, l.Length, "#32");
			*/
		}

38. Example

Project: DuckTyping
Source File: DuckTypingTestFixture.cs
View license
[Test]
        public void TestInterfaceProxyEvent()
        {
            Duck duck = new Duck();
 /n ..... /n //View Source file for more details /n }

39. Example

View license
[Test]
        [ExpectedException(typeof (ServiceNotFoundException))]
        public void ContainerMustThrowErrorIfServiceNotFound()
        {
            var container = new ServiceContainer();
            object instance = container.GetService(typeof (ISerializable));
            Assert.IsNull(instance, "The container is supposed to return a null instance");
        }

40. Example

View license
[Test]
        public void ContainerMustBeAbleToSupressServiceNotFoundErrors()
        {
            var container = new ServiceContainer();
            container.SuppressErrors = true;

            object instance = container.GetService(typeof (ISerializable));
            Assert.IsNull(instance, "The container is supposed to return a null instance");
        }

41. Example

View license
[Test]
        [ExpectedException(typeof (NamedServiceNotFoundException))]
        public void ContainerMustBeAbleToSuppressNamedServiceNotFoundErrors()
        {
            var container = new ServiceContainer();
            object instance = container.GetService("MyService", typeof (ISerializable));
            Assert.IsNull(instance, "The container is supposed to return a null instance");
        }

42. Example

Project: SharpZipLib
Source File: ZipFileHandling.cs
View license
[Test]
		[Category("Zip")]
		public void NullStreamDetected()
		{
			ZipFile bad = null;
			FileStream nullStream = null;

			bool nullStreamDetected = false;

			try {
				bad = new ZipFile(nullStream);
			} catch {
				nullStreamDetected = true;
			}

			Assert.IsTrue(nullStreamDetected, "Null stream should be detected in ZipFile constructor");
			Assert.IsNull(bad, "ZipFile instance should not be created");
		}

43. Example

Project: ActivityManager
Source File: ZipTests.cs
View license
[Test]
		[Category("Zip")]
		public void NullStreamDetected()
		{
			ZipFile bad = null;
			FileStream nullStream = null;

			bool nullStreamDetected = false;

			try {
				bad = new ZipFile(nullStream);
			}
			catch {
				nullStreamDetected = true;
			}

			Assert.IsTrue(nullStreamDetected, "Null stream should be detected in ZipFile constructor");
			Assert.IsNull(bad, "ZipFile instance should not be created");
		}

44. Example

Project: keepassrpc
Source File: TestComponentImporter.cs
View license
[ Test ]
        public void ImportEmptyObject()
        {
            Marriage m = (Marriage) Import(typeof(Marriage), "{}");
            Assert.IsNull(m.Husband, "Husband");
            Assert.IsNull(m.Wife, "Wife");
        }

45. Example

Project: mono-addins
Source File: TestExtensions.cs
View license
[Test()]
		public void TestGetUnknownOiitNode ()
		{
			ExtensionNode node = AddinManager.GetExtensionNode ("/Unknown");
			Assert.IsNull (node, "t1");
		}

46. Example

Project: mono-addins
Source File: TestExtensions.cs
View license
[Test()]
		public void TestGetNodeNotExtension ()
		{
			ExtensionNode node = AddinManager.GetExtensionNode ("/SimpleApp");
			Assert.IsNull (node, "node not null");
		}

47. Example

Project: mono-addins
Source File: TestExtensions.cs
View license
[Test()]
		public void TestGetUnknownExtensionNode ()
		{
			ExtensionNode node = AddinManager.GetExtensionNode ("/SimpleApp/Writers/Unknown");
			Assert.IsNull (node, "t1");
			
			node = AddinManager.GetExtensionNode ("/SimpleApp/Writers/SomeFile/Unknown");
			Assert.IsNull (node, "t2");
		}

48. Example

Project: nhibernate-core
Source File: LRUMapFixture.cs
View license
[Test]
		public void PutWithSizeLimitOfZero()
		{
			IDictionary cache = new LRUMap(0);

			cache.Add("key", "data");

			string data = (string)cache["key"];
			Assert.IsNull(data, "Data is wrong.");
		}

49. Example

Project: Jayrock
Source File: TestComponentImporter.cs
View license
[ Test ]
        public void ImportEmptyObject()
        {
            Marriage m = (Marriage) Import(typeof(Marriage), "{}");
            Assert.IsNull(m.Husband, "Husband");
            Assert.IsNull(m.Wife, "Wife");
        }

50. Example

Project: mono-reactive
Source File: DisposableTest.cs
View license
[Test]
		public void SimpleCreate ()
		{
			string s = null;
			var dis = Disposable.Create (() => s += "foo");
			Assert.IsNull (s, "#1");
			dis.Dispose ();
			Assert.AreEqual ("foo", s, "#2");
			dis.Dispose (); // call multiple time -> no error
			Assert.AreEqual ("foo", s, "#3"); // and no multiple invocation of action
		}