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

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

20 Examples 7

1. Example

Project: FieldWorks
Source File: WavConverterTests.cs
View license
[Test]
		public void ReadWavFile_ConvertSingleFile()
		{
			byte[] result = WavConverter.ReadWavFile(source);
			Assert.IsNotEmpty(result, "ReadWavFile did not read the bytes of a file into a byte array.");
		}

2. Example

View license
private List<VM> CreateVmList(string db, Predicate<VM> vmPredicate)
        {
            List<VM> vms = DatabaseManager.ConnectionFor(db).Cache.VMs.Where(vm => vmPredicate(vm)).ToList();
            Assert.IsNotEmpty(vms, "Selecting VMs for a test");
            return vms;
        }

3. Example

View license
[TestFixtureSetUp]
        public void TestSetup()
        {
            //one host pool

          /n ..... /n //View Source file for more details /n }

4. Example

View license
[Test]
    public void TestGetNodeText ()
    {

      Dictionary<string,string> AssetDic = new Dictionary<string, string> ();
      
      AssetDic.Add( 
        key: "TestHtmlDocument001",
        value: ""
      );

      foreach( string HtmlDocKey in this.HtmlDocs.Keys )
      {
        
        MacroscopeDocument msDoc = new MacroscopeDocument ( Url: "https://nazuke.github.io/" );
          
        string Html = this.HtmlDocs[ HtmlDocKey ];

        HtmlDocument HtmlDoc = new HtmlDocument ();

        HtmlDoc.LoadHtml( html: Html );

        List<string> CleanedText = msDoc.GetNodeText( Node: HtmlDoc.DocumentNode );

        Assert.IsNotEmpty( CleanedText, "CleanedText is empty" );

      }

    }

5. Example

Project: nunit
Source File: ConditionAssertTests.cs
View license
[Test]
        public void IsNotEmpty()
        {
            int[] array = new int[] { 1, 2, 3 };

            Assert.IsNotEmpty( "Hi!", "Failed on String" );
            Assert.IsNotEmpty( array, "Failed on Array" );
            Assert.IsNotEmpty( (IEnumerable)array, "Failed on IEnumerable" );

#if !NETCOREAPP1_1
            ArrayList list = new ArrayList(array);
            Hashtable hash = new Hashtable();
            hash.Add("array", array);

            Assert.IsNotEmpty(list, "Failed on ArrayList");
            Assert.IsNotEmpty(hash, "Failed on Hashtable");
#endif
        }

6. Example

View license
[Test]
		public void IsNotEmpty()
		{
			int[] array = new int[] { 1, 2, 3 };
			ArrayList list = new ArrayList( array );
			Hashtable hash = new Hashtable();
			hash.Add( "array", array );

			Assert.IsNotEmpty( "Hi!", "Failed on String" );
			Assert.IsNotEmpty( array, "Failed on Array" );
			Assert.IsNotEmpty( list, "Failed on ArrayList" );
			Assert.IsNotEmpty( hash, "Failed on Hashtable" );
		}

7. Example

View license
[Test]
		public void IsNotEmpty()
		{
			int[] array = new int[] { 1, 2, 3 };
			ArrayList list = new ArrayList( array );
			Hashtable hash = new Hashtable();
			hash.Add( "array", array );

			Assert.IsNotEmpty( "Hi!", "Failed on String" );
			Assert.IsNotEmpty( array, "Failed on Array" );
			Assert.IsNotEmpty( list, "Failed on ArrayList" );
			Assert.IsNotEmpty( hash, "Failed on Hashtable" );
		}

8. Example

View license
[Test]
		public void IsNotEmpty()
		{
			int[] array = new int[] { 1, 2, 3 };
			ArrayList list = new ArrayList( array );
			Hashtable hash = new Hashtable();
			hash.Add( "array", array );

			Assert.IsNotEmpty( "Hi!", "Failed on String" );
			Assert.IsNotEmpty( array, "Failed on Array" );
			Assert.IsNotEmpty( list, "Failed on ArrayList" );
			Assert.IsNotEmpty( hash, "Failed on Hashtable" );
            Assert.IsNotEmpty((IEnumerable)array, "Failed on IEnumerable");
		}

9. Example

View license
[Test]
		public void IsNotEmpty()
		{
			int[] array = new int[] { 1, 2, 3 };
			ArrayList list = new ArrayList( array );
			Hashtable hash = new Hashtable();
			hash.Add( "array", array );

			Assert.IsNotEmpty( "Hi!", "Failed on String" );
			Assert.IsNotEmpty( array, "Failed on Array" );
			Assert.IsNotEmpty( list, "Failed on ArrayList" );
			Assert.IsNotEmpty( hash, "Failed on Hashtable" );
		}

10. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test]
		public void IsNotEmpty()
		{
			int[] array = new int[] { 1, 2, 3 };
			ArrayList list = new ArrayList( array );
			Hashtable hash = new Hashtable();
			hash.Add( "array", array );

			Assert.IsNotEmpty( "Hi!", "Failed on String" );
			Assert.IsNotEmpty( array, "Failed on Array" );
			Assert.IsNotEmpty( list, "Failed on ArrayList" );
			Assert.IsNotEmpty( hash, "Failed on Hashtable" );
			Assert.IsNotEmpty( (IEnumerable)array, "Failed on IEnumerable" );
		}

11. Example

View license
[Test]
    public void TestTitlesOuterHtml ()
    {

      Dictionary<string,string> AssetDic /n ..... /n //View Source file for more details /n }

12. Example

View license
[Test]
    public void TestTitlesInnerText ()
    {

      Dictionary<string,string> AssetDic = new Dictionary<string, string> () {
        {
          "HtmlDoc001",
          "HtmlDoc001"
        },
        {
          "HtmlDoc002",
          "HtmlDoc002"
        },
        {
          "HtmlDoc003",
          "HtmlDoc003"
        },
        {
          "HtmlDoc004",
          "HtmlDoc004"
        },
        {
          "HtmlDoc005",
          "HtmlDoc005"
        }
      };

      MacroscopeDataExtractorXpaths DataExtractor = new MacroscopeDataExtractorXpaths ( Size: 1 );

      DataExtractor.SetXpath(
        Slot: 0,
        XpathLabel: "TestTitlesInnerText",
        XpathString: "//title",
        ExtractorType: MacroscopeConstants.DataExtractorType.INNERTEXT
      );

      DataExtractor.SetActiveInactive(
        Slot: 0,
        State: MacroscopeConstants.ActiveInactive.ACTIVE
      );
      
      foreach( string HtmlDocKey in this.HtmlDocs.Keys )
      {
           
        string Html = this.HtmlDocs[ HtmlDocKey ];

        List<KeyValuePair<string,?string>> ResultList = DataExtractor.AnalyzeHtml( Html: Html );

        DebugMsg( string.Format( "HtmlDocKey: {0} :: Value: {1}", HtmlDocKey, ResultList[ 0 ].Value ) );

        Assert.IsNotEmpty( ResultList, "WHOOPS!" );

        Assert.AreEqual( AssetDic[ HtmlDocKey ], ResultList[ 0 ].Value );

      }

    }

13. Example

View license
[Test]
    public void TestHeadingsLevel1 ()
    {

      Dictionary<string,string> AssetDic = new Dictionary<string, string> () {
        {
          "HtmlDoc001",
          "First Heading"
        },
        {
          "HtmlDoc002",
          "First Heading"
        },
        {
          "HtmlDoc003",
          "First Heading"
        },
        {
          "HtmlDoc004",
          "First Heading"
        },
        {
          "HtmlDoc005",
          "First Heading"
        }
      };

      MacroscopeDataExtractorCssSelectors DataExtractor = new MacroscopeDataExtractorCssSelectors ( Size: 1 );

      DataExtractor.SetCssSelector(
        Slot: 0,
        CssSelectorLabel: "TestHeadingsLevel1",
        CssSelectorString: "h1.heading",
        ExtractorType: MacroscopeConstants.DataExtractorType.INNERTEXT
      );

      DataExtractor.SetActiveInactive(
        Slot: 0,
        State: MacroscopeConstants.ActiveInactive.ACTIVE
      );

      foreach( string HtmlDocKey in this.HtmlDocs.Keys )
      {
           
        string Html = this.HtmlDocs[ HtmlDocKey ];

        List<KeyValuePair<string,?string>> ResultList = DataExtractor.AnalyzeHtml( Html: Html );

        DebugMsg( string.Format( "HtmlDocKey: {0} :: Value: {1}", HtmlDocKey, ResultList[ 0 ].Value ) );

        Assert.IsNotEmpty( ResultList, "WHOOPS!" );

        Assert.AreEqual( AssetDic[ HtmlDocKey ], ResultList[ 0 ].Value );

      }

    }

14. Example

View license
[Test]
    public void TestTitlesInnerHtml ()
    {

      Dictionary<string,string> AssetDic = new Dictionary<string, string> () {
        {
          "HtmlDoc001",
          "HtmlDoc001"
        },
        {
          "HtmlDoc002",
          "HtmlDoc002"
        },
        {
          "HtmlDoc003",
          "HtmlDoc003"
        },
        {
          "HtmlDoc004",
          "HtmlDoc004"
        },
        {
          "HtmlDoc005",
          "HtmlDoc005"
        }
      };

      MacroscopeDataExtractorXpaths DataExtractor = new MacroscopeDataExtractorXpaths ( Size: 1 );

      DataExtractor.SetXpath(
        Slot: 0,
        XpathLabel: "TestTitlesInnerHtml",
        XpathString: "//title",
        ExtractorType: MacroscopeConstants.DataExtractorType.INNERHTML
      );

      DataExtractor.SetActiveInactive(
        Slot: 0,
        State: MacroscopeConstants.ActiveInactive.ACTIVE
      );
      
      foreach( string HtmlDocKey in this.HtmlDocs.Keys )
      {
           
        string Html = this.HtmlDocs[ HtmlDocKey ];

        List<KeyValuePair<string,?string>> ResultList = DataExtractor.AnalyzeHtml( Html: Html );

        DebugMsg( string.Format( "HtmlDocKey: {0} :: Value: {1}", HtmlDocKey, ResultList[ 0 ].Value ) );

        Assert.IsNotEmpty( ResultList, "WHOOPS!" );

        Assert.AreEqual( AssetDic[ HtmlDocKey ], ResultList[ 0 ].Value );

      }

    }

15. Example

View license
[Test]
        public void CanGenerateColumnDefinitionsFromTableDDL()
        {
            List<ColumnDefinition> schema = SqliteSchemaDumper.GetColumnDefinitionsForTableDDL(CreateTableSql);

            Assert.IsNotNull(schema, "ColumnDefinition can't be null");
            Assert.IsNotEmpty(schema, "ColumnDefinition must have elements");
            Assert.AreEqual(schema.Count, 9, "Schema must have 9 columns");
        }

16. Example

View license
[Test]
		public void IsNotEmpty()
		{
			int[] array = new int[] { 1, 2, 3 };
			ArrayList list = new ArrayList( array );
			Hashtable hash = new Hashtable();
			hash.Add( "array", array );

			Assert.IsNotEmpty( "Hi!", "Failed on String" );
			Assert.IsNotEmpty( array, "Failed on Array" );
			Assert.IsNotEmpty( list, "Failed on ArrayList" );
			Assert.IsNotEmpty( hash, "Failed on Hashtable" );
            Assert.IsNotEmpty((IEnumerable)array, "Failed on IEnumerable");
		}

17. Example

View license
[Test]
		public void IsNotEmpty()
		{
			int[] array = new int[] { 1, 2, 3 };
			ArrayList list = new ArrayList( array );
			Hashtable hash = new Hashtable();
			hash.Add( "array", array );

			Assert.IsNotEmpty( "Hi!", "Failed on String" );
			Assert.IsNotEmpty( array, "Failed on Array" );
			Assert.IsNotEmpty( list, "Failed on ArrayList" );
			Assert.IsNotEmpty( hash, "Failed on Hashtable" );
		}

18. Example

Project: MyDriving
Source File: BasePage.cs
View license
public void AssertOnPage(TimeSpan? timeout = default(TimeSpan?))
		{
			if (Trait == null)
				throw new NullReferenceException("Trait not set");

			var message = "Unable to verify on page: " + this.GetType().Name;

			if (timeout == null)
				Assert.IsNotEmpty(App.Query(Trait), message);
			else
				Assert.DoesNotThrow(() => App.WaitForElement(Trait, timeout: timeout), message);
		}

19. Example

Project: app-evolve
Source File: BasePage.cs
View license
protected void AssertOnPage(TimeSpan? timeout = default(TimeSpan?))
        {
            if (Trait == null)
                throw new NullReferenceException("Trait not set");

            var message = "Unable to verify on page: " + this.GetType().Name;

            if (timeout == null)
                Assert.IsNotEmpty(app.Query(Trait), message);
            else
                Assert.DoesNotThrow(() => app.WaitForElement(Trait, timeout: timeout), message);
        }

20. Example

Project: xenadmin
Source File: I18nResourceFilesTests.cs
View license
[Test]
        public void TestEnsureI18nFilesInPlace()
        {
            var xenAdminTests = As/n ..... /n //View Source file for more details /n }