NUnit.Framework.Assert.IsEmpty(string)

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

49 Examples 7

1. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  \"Hi!\"" + Environment.NewLine;
			Assert.IsEmpty( "Hi!" );
		}

2. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  \"Hi!\"" + Environment.NewLine;
			Assert.IsEmpty( "Hi!" );
		}

3. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnNullString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.IsEmpty( (string)null );
		}

4. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnNullString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.IsEmpty( (string)null );
		}

5. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnNullString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.IsEmpty( (string)null );
		}

6. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  \"Hi!\"" + Environment.NewLine;
			Assert.IsEmpty( "Hi!" );
		}

7. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  \"Hi!\"" + Environment.NewLine;
			Assert.IsEmpty( "Hi!" );
		}

8. Example

Project: UnityAutoMoq
Source File: CoreTdd.cs
View license
public static void ShouldBeEmpty(this string @string)
        {
            Assert.IsEmpty(@string);
        }

9. Example

Project: Dominion
Source File: SpecificationExtensions.cs
View license
public static void ShouldBeEmpty(this string aString)
        {
            Assert.IsEmpty(aString);
        }

10. Example

Project: Dominion
Source File: SpecificationExtensions.cs
View license
public static void ShouldBeEmpty(this string aString)
        {
            Assert.IsEmpty(aString);
        }

11. Example

View license
public static void ShouldBeEmpty(this string aString)
    {
        Assert.IsEmpty(aString);
    }

12. Example

Project: Pash
Source File: FileSystemNavigationTests.cs
View license
[Test]
        public void CDToTildeShouldNotThrowException()
        {
            var rootPath = base.SetupFileSystemWithStructure(new[] { "/~/x" });

            var output = ("Set-Location " + rootPath + "; Set-Location ~").Exec();
            Assert.IsEmpty(output);
        }

13. Example

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

14. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnString()
		{
			expectedMessage =
				"  Expected: <empty>" + Env.NewLine +
				"  But was:  \"Hi!\"" + Env.NewLine;
			Assert.IsEmpty( "Hi!" );
		}

15. Example

Project: NemeStats
Source File: GetGameThumbnail_Tests.cs
View license
[Test]
            public void Then_Result_Is_Null()
            {
                Assert.IsEmpty(Result);
            }

16. Example

View license
[Test]
            public void Then_Return_Empty()
            {
                Assert.IsEmpty(Result);
            }

17. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnNullString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.IsEmpty( (string)null );
		}

18. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  \"Hi!\"" + Environment.NewLine;
			Assert.IsEmpty( "Hi!" );
		}

19. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnNullString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.IsEmpty( (string)null );
		}

20. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnNullString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.IsEmpty( (string)null );
		}

21. Example

View license
[Test, ExpectedException(typeof(AssertionException))]
		public void IsEmptyFailsOnString()
		{
			expectedMessage =
				"  Expected: <empty>" + Environment.NewLine +
				"  But was:  \"Hi!\"" + Environment.NewLine;
			Assert.IsEmpty( "Hi!" );
		}

22. Example

View license
public static void ShouldBeEmpty(this string aString)
        {
            Assert.IsEmpty(aString);
        }

23. Example

View license
[Test]
      public void CharacterSetECI_Should_Return_Usable_Charactersets()
      {
         var errors = String.Empty;
         foreach (var charSetEntry in CharacterSetECI.VALUE_TO_ECI)
         {
            try
            {
               Encoding.GetEncoding(charSetEntry.Value.EncodingName);
            }
            catch (Exception exc)
            {
               errors += exc.Message + Environment.NewLine;
            }
         }
         Assert.IsEmpty(errors);
      }

24. Example

Project: libpalaso
Source File: FileLocatorTests.cs
View license
[Test]
		public void LocateFile_FileNoteFound_ReturnsEmptyString()
		{
			var locator = new FileLocator(new[] { "bogus" });
			ErrorReport.IsOkToInteractWithUser = false;
			Assert.IsEmpty(locator.LocateFile("foo.txt"));
		}

25. Example

Project: Aspose.Words-for-.NET
Source File: ExShape.cs
View license
[Test]
        public void ObjectDidNotHaveSuggestedFileName()
        {
            Document doc = new Document(MyDir + "Shape.ActiveXObject.docx");

            Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
            Assert.IsEmpty(shape.OleFormat.SuggestedFileName);
        }

26. Example

Project: MadMilkman.Ini
Source File: IniFileWriteTests.cs
View license
[Test]
        public void WriteEmptyLinesTest()
        {
            IniOptions options = new IniOptions() { Encoding = Encoding.UTF8 };
            IniFile file = new IniFile(options);

            file.Sections.Add(
                new IniSection(file, "Section",
                    new IniKey(file, "Key")
                    {
                        TrailingComment = { Text = string.Empty, EmptyLinesBefore = 2 },
                        LeadingComment = { Text = string.Empty, EmptyLinesBefore = 1 }
                    })
                {
                    TrailingComment = { Text = string.Empty, EmptyLinesBefore = 2 },
                    LeadingComment = { Text = string.Empty, EmptyLinesBefore = 1 }
                });

            string[] lines = IniUtilities.SaveIniFileContent(file, options);
            Assert.IsEmpty(lines[0]);
            Assert.IsEmpty(lines[1]);
            Assert.AreEqual(";", lines[2]);
            Assert.IsEmpty(lines[3]);
            Assert.AreEqual("[Section];", lines[4]);
            Assert.IsEmpty(lines[5]);
            Assert.IsEmpty(lines[6]);
            Assert.AreEqual(";", lines[7]);
            Assert.IsEmpty(lines[8]);
            Assert.AreEqual("Key=;", lines[9]);
        }

27. Example

Project: Nustache
Source File: Describe_InvertedBlock.cs
View license
private static void AssertDoesntRender<T>(T value)
        {
            AssertRenderingResult((text, result) => Assert.IsEmpty(result), value);
        }

28. Example

Project: OneScript
Source File: oscriptTests.cs
View license
[Test]
		[Category("Script execution")]
		public void SimpleScriptExecutes()
		{
			using (var sw = new StringWriter())
			{
				Console.SetOut(sw);

				var args = new[]
				{
					_simpleScriptFullPath
				};

				Program.Main(args);
				var result = sw.ToString();
				Assert.IsEmpty(result);
			}
		}

29. Example

Project: nunit
Source File: ConditionAssertTests.cs
View license
[Test]
        public void IsEmptyFailsOnNullString()
        {
            var expectedMessage =
                "  Expected: <empty>" + Environment.NewLine +
                "  But was:  null" + Environment.NewLine;
            var ex = Assert.Throws<AssertionException>(() => Assert.IsEmpty( (string)null ));
            Assert.That(ex.Message, Is.EqualTo(expectedMessage));
        }

30. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

31. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

32. Example

View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

33. Example

View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

34. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

35. Example

View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

36. Example

View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

37. Example

Project: grisu.net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

38. Example

View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

39. Example

Project: Pash
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void EmptyStringTests()
		{
			// Classic syntax
			Assert.IsEmpty("");
			Assert.IsNotEmpty("Hello!");

			// Helper syntax
			Assert.That("", Is.Empty);
			Assert.That("Hello!", Is.Not.Empty);

			// Inherited syntax
			Expect("", Empty);
			Expect("Hello!", Not.Empty);
		}

40. Example

View license
[Test]
        public void EmptyStringTests()
        {
            // Classic syntax
            Assert.IsEmpty("");
            Assert.IsNotEmpty("Hello!");

            // Constraint Syntax
            Assert.That("", Is.Empty);
            Assert.That("Hello!", Is.Not.Empty);

            // Inherited syntax
            Expect("", Empty);
            Expect("Hello!", Not.Empty);
        }

41. Example

Project: nunit
Source File: ConditionAssertTests.cs
View license
[Test]
        public void IsEmptyFailsOnString()
        {
            var expectedMessage =
                "  Expected: <empty>" + Environment.NewLine +
                "  But was:  \"Hi!\"" + Environment.NewLine;
            var ex = Assert.Throws<AssertionException>(() => Assert.IsEmpty( "Hi!" ));
            Assert.That(ex.Message, Is.EqualTo(expectedMessage));
        }

42. Example

View license
[Test]
		public void SessionTest()
		{
			var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.English);

			var firstService = new AIDataService(config);
			var secondService = new AIDataService(config);

			{
				var weatherRequest = new AIRequest("weather");
				var weatherResponse = MakeRequest(firstService, weatherRequest);
                Assert.IsNotNull(weatherResponse);
			}

			{
				var checkSecondRequest = new AIRequest("check weather");
				var checkSecondResponse = MakeRequest(secondService, checkSecondRequest);
                Assert.IsEmpty(checkSecondResponse.Result.Action);
			}

			{
				var checkFirstRequest = new AIRequest("check weather");
				var checkFirstResponse = MakeRequest(firstService, checkFirstRequest);
				Assert.IsNotNull(checkFirstResponse.Result.Action);
				Assert.IsTrue(checkFirstResponse.Result.Action.Equals("checked", StringComparison.InvariantCultureIgnoreCase));
			}
		}

43. Example

Project: mono-addins
Source File: TestAddinDescription.cs
View license
[Test]
		public void PropertyLocalization ()
		{
			AddinDescription desc = new AddinDescription ();/n ..... /n //View Source file for more details /n }

44. Example

Project: NHttp
Source File: ExceptionInHandler.cs
View license
[Test]
        public void HandledHandlerExceptionWithoutOutput()
        {
            using (var server = new HttpServer())
            {
                server.RequestReceived += (s, e) =>
                {
                    throw new Exception();
                };

                server.UnhandledException += (s, e) =>
                {
                    e.Response.Status = "200 OK";
                    e.Handled = true;
                };

                server.Start();

                var request = (HttpWebRequest)WebRequest.Create(
                    String.Format("http://{0}/", server.EndPoint)
                );

                using (var response = (HttpWebResponse)request.GetResponse())
                {
                    Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
                    Assert.AreEqual("OK", response.StatusDescription);

                    using (var stream = response.GetResponseStream())
                    using (var reader = new StreamReader(stream))
                    {
                        Assert.IsEmpty(reader.ReadToEnd());
                    }
                }
            }
        }

45. Example

Project: ZetaLongPaths
Source File: DirectoryInfoTest.cs
View license
[Test]
        public void TestGeneral()
        {
            // Ordner mit Punkt am Ende.
        /n ..... /n //View Source file for more details /n }

46. Example

Project: NClass
Source File: AdoNetAppenderTest.cs
View license
[Test]
        public void WebsiteExample()
        {
            XmlDocument log4netConfig = new Xm/n ..... /n //View Source file for more details /n }

47. Example

View license
[Test]
		public void BufferingWebsiteExample()
		{
			XmlDocument log4netConfig = new XmlDocument();/n ..... /n //View Source file for more details /n }

48. Example

View license
[Test]
		public void WebsiteExample()
		{
			XmlDocument log4netConfig = new XmlDocument();
			#regi/n ..... /n //View Source file for more details /n }

49. Example

Project: sensus
Source File: Tests.cs
View license
private void AssertProtocolStatusEmpty(string statusScreenshotTitle)
        {
            TapProtocol(true);
            _app.WaitForElementThenTap(PROTOCOL_ACTION_SHEET_STATUS, false);
            _app.WaitForElement(GetStatusLinesQuery());
            _app.SetOrientationLandscape();
            _app.Screenshot(statusScreenshotTitle);
            string[] errorWarningMisc = _app.Query(GetStatusLinesQuery()).Select(c => c.Text).ToArray();
            Assert.AreEqual(errorWarningMisc.Length, 3);
            foreach (string line in errorWarningMisc)
                Assert.IsEmpty(line.Substring(line.IndexOf(":") + 1).Trim());

            _app.SetOrientationPortrait();
            _app.Back();  // to protocols page
        }