NUnit.Framework.Assert.IsNotEmpty(System.Collections.IEnumerable)

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

200 Examples 7

1. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
        public void IsNotEmptyFailsOnEmptyHashTable()
        {
            expectedMessage =
                "  Expected: not <empty>" + Environment.NewLine +
                "  But was:  <empty>" + Environment.NewLine;
            Assert.IsNotEmpty(new Hashtable());
        }

2. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArrayList()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new ArrayList() );
		}

3. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
        public void IsNotEmptyFailsOnEmptyIEnumerable()
        {
            expectedMessage =
                "  Expected: not <empty>" + Environment.NewLine +
                "  But was:  <empty>" + Environment.NewLine;
            Assert.IsNotEmpty((IEnumerable)new int[0]);
        }

4. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArray()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new int[0] );
		}

5. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArrayList()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new ArrayList() );
		}

6. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyHashTable()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new Hashtable() );
		}

7. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyHashTable()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new Hashtable() );
		}

8. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArray()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new int[0] );
		}

9. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArrayList()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new ArrayList() );
		}

10. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArray()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <empty>" + Environment.NewLine;
			Assert.IsNotEmpty( new int[0] );
		}

11. Example

View license
[Test]
        public void Test_ConfigProviders_Is_Not_Empty()
        {
            Assert.IsNotEmpty(_clusterManager.ConfigProviders);
        }

12. Example

View license
[Test]
        public void Test_Enumeration_Errors()
        {
            var stream = ResourceHelper.ReadResourceAsStream("Data\\errors_and_warnings.json");

            var response = new StreamingQueryResult<dynamic>
            {
                ResponseStream = stream
            };

            Assert.IsNotEmpty(response.Errors);
        }

13. Example

View license
[Test]
        public void Test_Enumeration_Warnings()
        {
            var stream = ResourceHelper.ReadResourceAsStream("Data\\errors_and_warnings.json");

            var response = new StreamingQueryResult<dynamic>
            {
                ResponseStream = stream
            };

            Assert.IsNotEmpty(response.Warnings);
        }

14. Example

Project: DropNetRT
Source File: ClientUserTests.cs
View license
[Test]
        public async Task Given_UserToken_When_Build_Auth_Url_Then_The_Authentication_Url_Is_Returned()
        {
            var client = new DropNetClient(AppKey, AppSecret);

            var userToken = await client.GetRequestToken();
            string url = client.BuildAuthorizeUrl(userToken, "http://cloudyboxapp.com");
            Assert.IsNotEmpty(url);
        }

15. Example

View license
[Test]
        public void CanGetIndexeColumnsFromIndexDDLSimple()
        {
            //var indexDDL1 = @"CREATE INDEX [IDX_USERS_LastLogin] ON [Users]([LastLogin]  DESC)";
            var indexDDL1 = @"[LastLogin]  DESC";
            var columns11 = SqliteSchemaDumper.GetIndexColumnsFromIndexDDL(indexDDL1);
            Assert.IsNotEmpty(columns11);
            columns11.Count.ShouldBe(1);
            var index1 = columns11.First();
            index1.Name.ShouldBe("LastLogin");
            index1.Direction.ShouldBe(Direction.Descending);
        }

16. Example

View license
[Test]
    public void AlreadyContainsNotificationVirtual()
    {
        var propertyDefinition = DefinitionFinder.FindProperty(() => new Virtual().WithNotificationProperty);

        var moduleWeaver = new ModuleWeaver();
        var propertyNames = moduleWeaver.GetAlreadyNotifies(propertyDefinition).ToList();
        Assert.IsNotEmpty(propertyNames);
    }

17. Example

View license
[Test]
    public void AlreadyContainsNotificationNonVirtual()
    {
        var propertyDefinition = DefinitionFinder.FindProperty(() => new NonVirtual().WithNotificationProperty);

        var moduleWeaver = new ModuleWeaver();
        var propertyNames = moduleWeaver.GetAlreadyNotifies(propertyDefinition).ToList();
        Assert.IsNotEmpty(propertyNames);
    }

18. Example

View license
[Test]
    public void AlreadyContainsNotificationVirtual()
    {
        var propertyDefinition = DefinitionFinder.FindProperty(() => new Virtual().WithNotificationProperty);

        var propertyNames = propertyDefinition.GetAlreadyNotifies("OnPropertyChanging");
        Assert.IsNotEmpty(propertyNames);
    }

19. Example

View license
[Test]
    public void AlreadyContainsNotificationNonVirtual()
    {
        var propertyDefinition = DefinitionFinder.FindProperty(() => new NonVirtual().WithNotificationProperty);

        var propertyNames = propertyDefinition.GetAlreadyNotifies("OnPropertyChanging");
        Assert.IsNotEmpty(propertyNames);
    }

20. Example

Project: FreeSCADA
Source File: PluginLoadingTest.cs
View license
[Test]
		public void Initialization()
		{
            
			System.Windows.Forms.MenuStrip menu = new System.Windows.Forms.MenuStrip();
			Env.Initialize(null, new Commands(menu, null), FreeSCADA.Interfaces.EnvironmentMode.Designer);

			Plugin plugin = (Plugin)Env.Current.CommunicationPlugins["data_simulator_plug"];

			ICommandContext context = Env.Current.Commands.GetContext(PredefinedContexts.Communication);
            Assert.IsNotEmpty(context.GetCommands());

			Env.Deinitialize();
		}

21. Example

View license
[Test]
		public void ConfigPaths()
		{
			Assert.IsNotEmpty(ConfigurationManager.UserConfigFolder);
			Assert.IsNotEmpty(ConfigurationManager.DefaultConfigFolder);
		}

22. Example

Project: FreeSCADA
Source File: PluginLoadingTest.cs
View license
[Test]
		public void Initialization()
		{
			System.Windows.Forms.MenuStrip menu = new System.Windows.Forms.MenuStrip();
			Env.Initialize(null, new Commands(menu, new System.Windows.Forms.ToolStrip()), FreeSCADA.Interfaces.EnvironmentMode.Designer);

			Plugin plugin = (Plugin)Env.Current.CommunicationPlugins["opc_connection_plug"];

			ICommandContext context = Env.Current.Commands.GetContext(PredefinedContexts.Communication);
			Assert.IsNotEmpty(context.GetCommands());

			Env.Deinitialize();
		}

23. Example

Project: tdd-toolkit
Source File: AnySpecification.cs
View license
[Test]
    public void ShouldTryToUsePublicStaticNonRecursiveFactoryMethodsOverPublicRecursiveConstructors()
    {
      var o2 = Any.Instance<ComplexObjectWithFactoryMethodAndRecursiveConstructor>();

      XAssert.NotNull(o2.ToString());
      Assert.IsNotEmpty(o2.ToString());
    }

24. Example

View license
public static void ShouldNotBeEmpty(this ICollection collection)
        {
            Assert.IsNotEmpty(collection);
        }

25. Example

Project: SharpNL
Source File: ParseTest.cs
View license
[Test]
        public void TestToString() {
            var p1 = Parse.ParseParse(parseString);
            Assert.IsNotEmpty(p1.ToString());
        }

26. Example

Project: SharpNL
Source File: SpanTest.cs
View license
[Test]
        public void TestToString() {
            Assert.IsNotEmpty(new Span(50, 100).ToString());
        }

27. Example

Project: SharpNL
Source File: DictionaryTest.cs
View license
[Test]
        public void TestToString() {
            var a = new SharpNL.Dictionary.Dictionary(false) {new StringList(new[] {"1a", "1b"})};
            Assert.IsNotEmpty(a.ToString());
        }

28. Example

Project: linq2db
Source File: SelectTests.cs
View license
[Test, DataContextSource]
		public void SelectComplex3(string context)
		{
			var ms = new MappingSchema();
			var b  = ms.GetFluentMappingBuilder();

			b
				.Entity<ComplexPerson3>()        .HasTableName ("Person")
				.Property(_ => _.ID)             .HasColumnName("PersonID")
				.Property(_ => _.Name.FirstName) .HasColumnName("FirstName")
				.Property(_ => _.Name.LastName)  .HasColumnName("LastName")
				.Property(_ => _.Name.MiddleName).HasColumnName("MiddleName");

			using (var db = GetDataContext(context, ms))
			{
				var r = db.GetTable<ComplexPerson3>().First(_ => _.ID == 1);

				Assert.IsNotEmpty(r.Name.FirstName);
				Assert.IsNotEmpty(r.Name.MiddleName);
				Assert.IsNotEmpty(r.Name.LastName);
			}
		}

29. Example

Project: linq2db
Source File: Issue496Tests.cs
View license
[Test, DataContextSource]
		public void Test3(string context)
		{
			using (var db = GetDataContext(context))
			{
				var children = db.GetTable<Parent2>()
					.Where(_ => _.ParentID == 1)
					.SelectMany(_ => _.Children)
					.ToList();

				Assert.IsNotEmpty(children);

				var expected = Child.Where(_ => _.ParentID == 1);
				var result = children.Select(_ => new Model.Child() { ChildID = _.ChildID, ParentID = (int)_.ParentID });

				AreEqual(expected, result);
			}
		}

30. Example

Project: linq2db
Source File: Issue496Tests.cs
View license
[Test, DataContextSource]
		public void Test2(string context)
		{
			using (new AllowMultipleQuery())
			using (var db = GetDataContext(context))
			{
				var children = db.GetTable<Parent1>()
					.Select(_ => new {_.Children})
					.ToList();

				Assert.IsNotEmpty(children);
			}
		}

31. Example

Project: linq2db
Source File: Issue175Tests.cs
View license
[Test, DataContextSource]
		public void Test(string context)
		{
			using (var db = GetDataContext(context))
			{
				var q = from c in db.GetTable<Child>()
						join p in db.GetTable<Parent>() on c.ParentID equals p.ParentID
						select c;

				Assert.IsNotEmpty(q);
			}
		}

32. Example

Project: linq2db
Source File: Issue496Tests.cs
View license
[Test, DataContextSource]
		public void Test4(string context)
		{
			using (new AllowMultipleQuery())
			using (var db = GetDataContext(context))
			{
				var children = db.GetTable<Parent2>()
					.Select(_ => new {_.Children})
					.ToList();

				Assert.IsNotEmpty(children);
			}
		}

33. Example

Project: linq2db
Source File: SelectTests.cs
View license
[Test, DataContextSource]
		public void SelectComplex1(string context)
		{
			using (var db = GetDataContext(context))
			{
				var r = db.GetTable<ComplexPerson>().First(_ => _.ID == 1);

				Assert.IsNotEmpty(r.Name.FirstName);
				Assert.IsNotEmpty(r.Name.MiddleName);
				Assert.IsNotEmpty(r.Name.LastName);
			}
		}

34. Example

Project: linq2db
Source File: JoinTests.cs
View license
[Test, IncludeDataContextSource(ProviderName.SqlServer2008, ProviderName.SqlServer2012, ProviderName.SqlServer2014)]
		public void StackOverflow(string context)
		{
			using (var db = GetDataContext(context))
			{
				var q =
					from c in db.Child
					join p in db.Parent on c.ParentID equals p.ParentID
					select new { p, c };

				for (var i = 0; i < 100; i++)
				{
					q =
						from c in q
						join p in db.Parent on c.p.ParentID equals p.ParentID
						select new { p, c.c };
				}

				var list = q.ToList();
				Assert.IsNotEmpty(list);
			}
		}

35. Example

Project: linq2db
Source File: Issue496Tests.cs
View license
[Test, DataContextSource]
		public void Test1(string context)
		{
			using (var db = GetDataContext(context))
			{
				var children = db.GetTable<Parent1>()
					.Where(_ => _.ParentID == 1)
					.SelectMany(_ => _.Children)
					.ToList();

				Assert.IsNotEmpty(children);

				var expected = Child.Where(_ => _.ParentID == 1);
				var result = children.Select(_ => new Model.Child() { ChildID = _.ChildID, ParentID = _.ParentID.Value });

				AreEqual(expected, result);
			}
		}

36. Example

Project: linq2db
Source File: SelectTests.cs
View license
[Test, DataContextSource]
		public void SelectComplex2(string context)
		{
			using (var db = GetDataContext(context))
			{
				var r = db.GetTable<ComplexPerson2>().First(_ => _.ID == 1);

				Assert.IsNotEmpty(r.Name.FirstName);
				Assert.IsNotEmpty(r.Name.MiddleName);
				Assert.IsNotEmpty(r.Name.LastName);
			}
		}

37. Example

Project: linq2db
Source File: InheritanceTests.cs
View license
[Test]
		public void InheritanceMappingIssueTest()
		{
			using (var db = new TestDataConnection())
			{
				var q1 = db.GetTable<Parent222>();
				var q  = q1.Where(_ => _.Value.ID == 1);

				var sql = ((IExpressionQuery<Parent222>)q).SqlText;
				Assert.IsNotEmpty(sql);
			}
		}

38. Example

Project: mvcturbine
Source File: BladeListTest.cs
View license
[Test]
        public void Can_Add_Valid_Blade_To_List() {
            var list = new BladeList {new MockBlade()};

            Assert.IsNotEmpty(list);
        }

39. Example

Project: mvcturbine
Source File: BladeListTest.cs
View license
[Test]
        public void List_Initialized_With_Valid_List_Has_Items() {
            var list = new BladeList(new List<IBlade> {new MockBlade()});
            Assert.IsNotEmpty(list);
        }

40. Example

Project: mvcturbine
Source File: BladeListTest.cs
View license
[Test]
        public void Can_Add_Null_Blade_To_List() {
            var list = new BladeList {null};

            Assert.IsNotEmpty(list);
        }

41. Example

Project: Simple.Data
Source File: FindTests.cs
View license
[Test]
        public void TestAll()
        {
            var db = Database.OpenFile(DatabasePath);
            var all = new List<object>(db.Users.All().Cast<dynamic>());
            Assert.IsNotEmpty(all);
        }

42. Example

Project: NemeStats
Source File: GetUserGames_Tests.cs
View license
[Test]
            public void Then_Returns_A_Filled_List()
            {
                Assert.IsNotEmpty(Result);
            }

43. Example

Project: NemeStats
Source File: SearchBoardGames_Tests.cs
View license
[Test]
            public void Then_Returns_A_Filled_List()
            {
                Assert.IsNotEmpty(Result);
            }

44. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArrayList()
		{
			expectedMessage =
				"  Expected: not <empty>" + Env.NewLine +
				"  But was:  <empty>" + Env.NewLine;
			Assert.IsNotEmpty( new ArrayList() );
		}

45. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
        public void IsNotEmptyFailsOnEmptyIEnumerable()
        {
            expectedMessage =
                "  Expected: not <empty>" + Environment.NewLine +
                "  But was:  <empty>" + Environment.NewLine;
            Assert.IsNotEmpty((IEnumerable)new int[0]);
        }

46. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyHashTable()
		{
			expectedMessage =
				"  Expected: not <empty>" + Env.NewLine +
				"  But was:  <empty>" + Env.NewLine;
			Assert.IsNotEmpty( new Hashtable() );
		}

47. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyArray()
		{
			expectedMessage =
				"  Expected: not <empty>" + Env.NewLine +
				"  But was:  <empty>" + Env.NewLine;
			Assert.IsNotEmpty( new int[0] );
		}

48. Example

View license
public static void ShouldNotBeEmpty(this ICollection collection)
    {
        Assert.IsNotEmpty(collection);
    }

49. Example

Project: Dominion
Source File: SpecificationExtensions.cs
View license
public static void ShouldNotBeEmpty(this ICollection collection)
        {
            Assert.IsNotEmpty(collection);
        }

50. Example

Project: Dominion
Source File: SpecificationExtensions.cs
View license
public static void ShouldNotBeEmpty(this ICollection collection)
        {
            Assert.IsNotEmpty(collection);
        }