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

Here are the examples of the csharp api class NUnit.Framework.Assert.IsEmpty(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 IsEmptyFailsOnNonEmptyArray()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  < 1, 2, 3 >" + Environment.NewLine;
			Assert.IsEmpty( new int[] { 1, 2, 3 } );
		}

2. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
        public void IsEmptyFailsOnNonEmptyArray()
        {
            expectedMessage =
                "  Expected: <empty>" + Environment.NewLine +
                "  But was:  < 1, 2, 3 >" + Environment.NewLine;
            Assert.IsEmpty(new int[] { 1, 2, 3 });
        }

3. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnNonEmptyArray()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  < 1, 2, 3 >" + Environment.NewLine;
			Assert.IsEmpty( new int[] { 1, 2, 3 } );
		}

4. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
        public void IsEmptyFailsOnNonEmptyIEnumerable()
        {
            expectedMessage =
                "  Expected: <empty>" + Environment.NewLine +
                "  But was:  < 1, 2, 3 >" + Environment.NewLine;
            Assert.IsEmpty((IEnumerable)new int[] { 1, 2, 3 });
        }

5. Example

View license
[Test]
        public async Task Query_WhenInvalidUri_FacetsIsEmpty()
        {
            ConfigContextBase.SearchUris.Add(new FailureCountingUri("http://10.141.151.101:8091/"));
            var fakeMessageHandler = new FakeMessageHandler
            {
                StatusCode = HttpStatusCode.NotFound,
                Content = new StringContent("Requested resource not found. ")
            };

            var client = new SearchClient(new HttpClient(fakeMessageHandler), new SearchDataMapper());
            var response = await client.QueryAsync(new SearchQuery
            {
                Index = "indexdoesnotexist",
                Query = new MatchQuery("foo")
            });
            Assert.IsEmpty(response.Facets);
        }

6. Example

View license
[Test]
        public async Task Query_WhenInvalidIndexName_FacetsIsEmpty()
        {
            ConfigContextBase.SearchUris.Add(new FailureCountingUri("http://10.141.151.101:8091/"));
            var fakeMessageHandler = new FakeMessageHandler
            {
                StatusCode = HttpStatusCode.Forbidden,
                Content = new StringContent("rest_auth: preparePerm, err: index not found ")
            };

            var client = new SearchClient(new HttpClient(fakeMessageHandler), new SearchDataMapper());
            var response = await client.QueryAsync(new SearchQuery
            {
                Index = "indexdoesnotexist",
                Query = new MatchQuery("foo")
            });
            Assert.IsEmpty(response.Facets);
        }

7. Example

Project: FluentBootstrap
Source File: TestHelper.cs
View license
public static HtmlDocument Render<TView>()
            where TView : WebViewPage, new()
        {
            WebViewPage<dynamic> view = new TView() as WebViewPage<dynamic>;
            HtmlDocument doc = view.RenderAsHtml();
            Assert.IsEmpty(doc.ParseErrors.Where(x => x.Code != HtmlParseErrorCode.EndTagNotRequired));
            return doc;
        }

8. Example

Project: FluentBootstrap
Source File: TestHelper.cs
View license
public static HtmlDocument Render<TView, TModel>(TModel model = default(TModel))
            where TView : WebViewPage<TModel>, new()
        {
            var view = new TView();
            HtmlDocument doc = view.RenderAsHtml(model);
            Assert.IsEmpty(doc.ParseErrors.Where(x => x.Code != HtmlParseErrorCode.EndTagNotRequired));
            return doc;
        }

9. Example

Project: CSMSL
Source File: ChemicalFormulaTestFixture.cs
View license
[Test]
        public void EmptyStringIsBlank()
        {
            Assert.IsEmpty(ChemicalFormula.Empty.Formula);
        }

10. Example

View license
[Test]
        public void DecodeQuotedPrintable_Empty()
        {

            // Empty should be returned if Empty is specified.

            Assert.IsEmpty(
                vCardStandardReader.DecodeQuotedPrintable(string.Empty));
        }

11. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_Department()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.Department,
                "Department is not string.Empty.");

            card.Department = null;

            Assert.IsEmpty(
                card.Department,
                "Department is not string.Empty after being assigned null.");

        }

12. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_Mailer()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.Mailer,
                "Mailer is not string.Empty.");

            card.Mailer = null;

            Assert.IsEmpty(
                card.Mailer,
                "Mailer is not string.Empty after being assigned null.");

        }

13. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_DisplayName()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.DisplayName,
                "DisplayName is not string.Empty.");

            card.DisplayName = null;

            Assert.IsEmpty(
                card.DisplayName,
                "DisplayName is not string.Empty after being assigned null.");

        }

14. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_Role()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.Role,
                "Role is not string.Empty.");

            card.Role = null;

            Assert.IsEmpty(
                card.Role,
                "Role is not string.Empty after being assigned null.");

        }

15. Example

View license
[Test]
        public void Constructor()
        {

            vCardEmailAddress email = new vCardEmailAddress();

            Assert.IsEmpty(
                email.Address,
                "The Address property should default to String.Empty.");

        }

16. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_Office()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.Office,
                "Office is not string.Empty.");

            card.Office = null;

            Assert.IsEmpty(
                card.Office,
                "Office is not string.Empty after being assigned null.");

        }

17. Example

View license
[Test]
        public void DecodeEscaped_Empty()
        {
            Assert.IsEmpty(
                vCardStandardReader.DecodeEscaped(string.Empty));
        }

18. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_FormattedName()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.FormattedName,
                "FormattedName is not string.Empty.");

            card.FormattedName = null;

            Assert.IsEmpty(
                card.FormattedName,
                "FormattedName is not string.Empty after being assigned null.");

        }

19. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_UniqueId()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.UniqueId,
                "UniqueId is not string.Empty.");

            card.UniqueId = null;

            Assert.IsEmpty(
                card.UniqueId,
                "UniqueId is not string.Empty after being assigned null.");

        }

20. Example

Project: Thought.vCards
Source File: vCardPhoneTests.cs
View license
[Test]
        public void EmptyString_FullNumber()
        {

            vCardPhone phone = new vCardPhone();

            Assert.IsEmpty(
                phone.FullNumber,
                "The full number should default to String.Empty.");

            phone.FullNumber = null;

            Assert.IsEmpty(
                phone.FullNumber,
                "The FullNumber property should return String.Empty instead of null.");

        }

21. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_FamilyName()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.FamilyName,
                "FamilyName is not string.Empty.");

            card.FamilyName = null;

            Assert.IsEmpty(
                card.FamilyName,
                "FamilyName is not string.Empty after being assigned null.");

        }

22. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_ProductId()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.ProductId,
                "ProductId is not string.Empty.");

            card.ProductId = null;

            Assert.IsEmpty(
                card.ProductId,
                "ProductId is not string.Empty after being assigned null.");

        }

23. Example

View license
[Test]
        public void EmptyString_City()
        {

            vCardDeliveryAddress address = new vCardDeliveryAddress();

            Assert.IsEmpty(
                address.City,
                "The City property should default to String.Empty.");

            address.City = null;

            Assert.IsEmpty(
                address.City,
                "The City property should return String.Empty instead of null.");

        }

24. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_GivenName()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.GivenName,
                "GivenName is not string.Empty.");

            card.GivenName = null;

            Assert.IsEmpty(
                card.GivenName,
                "GivenName is not string.Empty after being assigned null.");

        }

25. Example

View license
[Test]
        public void EmptyString_KeyType()
        {

            vCardCertificate cert = new vCardCertificate();

            Assert.IsEmpty(
                cert.KeyType,
                "The string KeyType property should default to String.Empty.");

            cert.KeyType = null;

            Assert.IsEmpty(
                cert.KeyType,
                "The string KeyType should be String.Empty when assigned null.");

        }

26. Example

Project: Thought.vCards
Source File: vCardWebSiteTests.cs
View license
[Test]
        public void Constructor_NullUrl()
        {
            vCardWebsite site = new vCardWebsite((string)null);

            Assert.IsEmpty(
                site.Url,
                "The Url should be String.Empty even when initialized to null.");

        }

27. Example

View license
[Test]
        public void EncodeQuotedPrintable_Empty()
        {

            Assert.IsEmpty(
                vCardStandardWriter.EncodeQuotedPrintable(string.Empty));

        }

28. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_TimeZone()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.TimeZone,
                "TimeZone is not string.Empty.");

            card.TimeZone = null;

            Assert.IsEmpty(
                card.TimeZone,
                "TimeZone is not string.Empty after being assigned null.");

        }

29. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_Title()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.Title,
                "Title is not string.Empty.");

            card.Title = null;

            Assert.IsEmpty(
                card.Title,
                "Title is not string.Empty after being assigned null.");

        }

30. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_Organization()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.Organization,
                "Organization is not string.Empty.");

            card.Organization = null;

            Assert.IsEmpty(
                card.Organization,
                "Organization is not string.Empty after being assigned null.");

        }

31. Example

View license
[Test]
        public void EmptyString_PostalCode()
        {

            vCardDeliveryAddress address = new vCardDeliveryAddress();

            Assert.IsEmpty(
                address.PostalCode,
                "The PostalCode property should default to String.Empty.");

            address.PostalCode = null;

            Assert.IsEmpty(
                address.PostalCode,
                "The PostalCode property should return String.Empty instead of null.");

        }

32. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_NameSuffix()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.NameSuffix,
                "NameSuffix is not string.Empty.");

            card.NameSuffix = null;

            Assert.IsEmpty(
                card.NameSuffix,
                "NameSuffix is not string.Empty after being assigned null.");

        }

33. Example

View license
[Test]
        public void EmptyString_Country()
        {

            vCardDeliveryAddress address = new vCardDeliveryAddress();

            Assert.IsEmpty(
                address.Country,
                "The Country property should default to String.Empty.");

            address.Country = null;

            Assert.IsEmpty(
                address.Country,
                "The Country property should return String.Empty instead of null.");

        }

34. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_AdditionalNames()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.AdditionalNames,
                "AdditionalNames is not string.Empty.");

            card.AdditionalNames = null;

            Assert.IsEmpty(
                card.AdditionalNames,
                "AdditionalNames is not string.Empty after being assigned null.");

        }

35. Example

View license
[Test]
        public void EmptyString_Region()
        {

            vCardDeliveryAddress address = new vCardDeliveryAddress();

            Assert.IsEmpty(
                address.Region,
                "The Region property should default to String.Empty.");

            address.Region = null;

            Assert.IsEmpty(
                address.Region,
                "The Region property should return String.Empty instead of null.");

        }

36. Example

View license
[Test]
        public void Constructor()
        {

            // Tests the default values of the address constructor.

            vCardDeliveryAddress address = new vCardDeliveryAddress();

            Assert.IsEmpty(
                address.City,
                "The City property should default to String.Empty.");

            Assert.IsEmpty(
                address.Country,
                "The Country property should default to String.Empty.");

            Assert.IsEmpty(
                address.PostalCode,
                "The PostalCode property should default to String.Empty.");

            Assert.IsEmpty(
                address.Region,
                "The Region property should default to String.Empty.");

            Assert.IsEmpty(
                address.Street,
                "The Street property should default to String.Empty.");

        }

37. Example

View license
[Test]
        public void EmptyString_Street()
        {

            vCardDeliveryAddress address = new vCardDeliveryAddress();

            Assert.IsEmpty(
                address.Street,
                "The Street property should default to String.Empty.");

            address.Street = null;

            Assert.IsEmpty(
                address.Street,
                "The Street property should return String.Empty instead of null.");

        }

38. Example

Project: Thought.vCards
Source File: vCardTests.cs
View license
[Test]
        public void StringEmpty_NamePrefix()
        {

            vCard card = new vCard();

            Assert.IsEmpty(
                card.NamePrefix,
                "NamePrefix is not string.Empty.");

            card.NamePrefix = null;

            Assert.IsEmpty(
                card.NamePrefix,
                "NamePrefix is not string.Empty after being assigned null.");


        }

39. Example

View license
[Test]
		public void PlaceholderGettingWhichNotExistsReturnsEmpty()
		{
			using (var document = new DocxDocument(Resources.WithMainContentTag))
			{
				var placeholders = DocumentPlaceholder.Get(document.GetWordDocument(), "NON_EXISTING");

				Assert.IsEmpty(placeholders);
			}
		}

40. Example

Project: TabulaRasa
Source File: DocumentTagTests.cs
View license
[Test]
		public void TagGettingWhichNotExistsReturnsEmpty()
		{
			using (var document = new DocxDocument(Resources.WithMainContentTag))
			{
				var tags = DocumentTag.Get(document.GetWordDocument(), "NON_EXISTING");

                Assert.IsEmpty(tags);
			}
		}

41. Example

View license
[Test]
        public void Serialize_WithTestTable2_AndEmptyString_CanBeReadByOracle()
        {
            var serializer = new FlatBuffersSerializer();

            var obj = new TestTable2() { StringProp = string.Empty };

            var buffer = new byte[64];
            serializer.Serialize(obj, buffer, 0, buffer.Length);

            var oracle = new SerializationTestOracle();
            var oracleResult = oracle.ReadTestTable2(buffer);

            Assert.IsEmpty(oracleResult.StringProp);
        }

42. Example

View license
[Test]
        public void doesnt_add_entities_when_deactivated()
        {
            Pool.CreateEntity().Add<NameTestComponent>(n => n.Name = "Aler");
            Assert.IsEmpty(Index.GetEntities("Aler"));
        }

43. Example

View license
[Test]
    public void WillNotGetTokenWhenNoFileExists()
    {
      var token = _repository.Get();
      Assert.IsEmpty(token.TokenString);
      Assert.IsEmpty(token.Secret);
    }

44. Example

Project: AssertMessage
Source File: NunitTests.cs
View license
public void IsEmpty_should_have_message_for_collection()
        {
            var actual = new[]{new object()};

            Assert.IsEmpty(actual);
        }

45. Example

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

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

46. Example

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

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

47. Example

View license
[Test]
        public void ShouldGetEmptyTagListByDefault()
        {
            var tags = AssertEx.ExecuteProtectedMethod<ExecutionEndingProcessor>("GetApplicableTags", _request);
            Assert.IsEmpty(tags);
        }

48. Example

View license
[Test]
        public void ShouldGetEmptyTagListByDefault()
        {
            var specInfo = new SpecInfo
            {
                Tags = {"foo"},
                Name = "",
                FileName = "",
                IsFailed = false
            };
            var scenarioInfo = new ScenarioInfo
            {
                Tags = {"bar"},
                Name = "",
                IsFailed = false
            };
            var currentScenario = new ExecutionInfo
            {
                CurrentScenario = scenarioInfo,
                CurrentSpec = specInfo
            };
            var currentExecutionInfo = new ScenarioExecutionStartingRequest
            {
                CurrentExecutionInfo = currentScenario
            };
            var message = new Message
            {
                ScenarioExecutionStartingRequest = currentExecutionInfo,
                MessageType = Message.Types.MessageType.ScenarioExecutionStarting,
                MessageId = 0
            };

            var tags = AssertEx.ExecuteProtectedMethod<ExecutionStartingProcessor>("GetApplicableTags", message);
            Assert.IsEmpty(tags);
        }

49. Example

Project: il-repack
Source File: CommandLineTests.cs
View license
[Test]
        public void WithEmptyOption__GetOption__ReturnEmptyString()
        {
            string[] arguments = { "/" };
            var commandLine = new CommandLine(arguments);
            var option = commandLine.Option("");
            Assert.IsEmpty(option);
        }

50. Example

Project: il-repack
Source File: CommandLineTests.cs
View license
[Test]
        public void WithNoArguments__NewObject__NoOtherArguments()
        {
            string[] arguments = { };
            var commandLine = new CommandLine(arguments);
            Assert.IsEmpty(commandLine.OtherAguments);
        }