NUnit.Framework.Assert.IsNotEmpty(string)

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

52 Examples 7

1. Example

Project: ContinuousTests
Source File: ConditionAssertTests.cs
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyString()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <string.Empty>" + Environment.NewLine;
			Assert.IsNotEmpty( "" );
		}

2. Example

Project: ContinuousTests
Source File: ConditionAssertTests.cs
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyString()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <string.Empty>" + Environment.NewLine;
			Assert.IsNotEmpty( "" );
		}

3. Example

Project: ContinuousTests
Source File: ConditionAssertTests.cs
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyString()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <string.Empty>" + Environment.NewLine;
			Assert.IsNotEmpty( "" );
		}

4. Example

Project: fluent-nhibernate
Source File: SpecificationExtensions.cs
public static void ShouldNotBeEmpty(this string aString)
        {
            Assert.IsNotEmpty(aString);
        }

5. Example

Project: NemeStats
Source File: GetGameThumbnail_Tests.cs
[Test]
            public void Then_Returns_Filled_Object()
            {
                Assert.IsNotEmpty(Result);
            }

6. Example

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

7. Example

Project: Pash
Source File: NUnitSpecificationExtensions.cs
public static void ShouldNotBeEmpty(this string aString)
    {
        Assert.IsNotEmpty(aString);
    }

8. Example

Project: Dominion
Source File: SpecificationExtensions.cs
public static void ShouldNotBeEmpty(this string aString)
        {
            Assert.IsNotEmpty(aString);
        }

9. Example

Project: Dominion
Source File: SpecificationExtensions.cs
public static void ShouldNotBeEmpty(this string aString)
        {
            Assert.IsNotEmpty(aString);
        }

10. Example

Project: UnityAutoMoq
Source File: CoreTdd.cs
public static string ShouldNotBeEmpty(this string @string)
        {
            Assert.IsNotEmpty(@string);
            return @string;
        }

11. Example

Project: AutoTest.Net
Source File: ConditionAssertTests.cs
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyString()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <string.Empty>" + Environment.NewLine;
			Assert.IsNotEmpty( "" );
		}

12. Example

Project: AutoTest.Net
Source File: ConditionAssertTests.cs
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyString()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <string.Empty>" + Environment.NewLine;
			Assert.IsNotEmpty( "" );
		}

13. Example

Project: AutoTest.Net
Source File: ConditionAssertTests.cs
[Test, ExpectedException(typeof(AssertionException))]
		public void IsNotEmptyFailsOnEmptyString()
		{
			expectedMessage =
				"  Expected: not <empty>" + Environment.NewLine +
				"  But was:  <string.Empty>" + Environment.NewLine;
			Assert.IsNotEmpty( "" );
		}

14. Example

Project: NLipsum
Source File: LipsumTests.cs
[Test]
		public void TestGenerateNoParams() {
			string rawText = Lipsums.LoremIpsum;
			string generated = LipsumGenerator.Generate(1);

			// What can I test to make sure this is working properly?
			// Null and empty don't seem like valid tests.

			Assert.IsNotNull(generated);
			Assert.IsNotEmpty(generated);
		}

15. Example

Project: FreeSCADA
Source File: CommunationPlugsTest.cs
[Test]
		public void Indexer()
		{
			foreach (string plug in Env.Current.CommunicationPlugins.PluginIds)
			{
				Assert.IsNotEmpty(plug);
				Assert.IsNotNull(Env.Current.CommunicationPlugins[plug]);
			}
		}

16. Example

Project: GreenPipes
Source File: DictionaryToObject_Specs.cs
[Test]
        public void Should_include_a_string()
        {
            Assert.IsNotEmpty(_values.StringValue);
            Assert.AreEqual("Hello", _values.StringValue);
        }

17. Example

Project: Jayrock
Source File: TestJsonRpcError.cs
[ Test ]
        public void StackTraceInclusion()
        {
            ApplicationException exception = new ApplicationException();
            JsonObject error = JsonRpcError.FromException(ThrowAndCatch(exception), true);
            string trace = (string) error["stackTrace"];
            Assert.IsNotNull(trace);
            Assert.IsNotEmpty(trace);
        }

18. Example

Project: FieldWorks
Source File: ManagedLgIcuCollatorTests.cs
[Test()]
		[Category("ByHand")]
		[ExpectedException(typeof(NotImplementedException))]
		public void GetSortKeyTest()
		{
			using (var icuCollator = ManagedLgIcuCollatorInitializerHelper())
			{
				Assert.IsNotNull(icuCollator);

				var options = new LgCollatingOptions();

				string result = icuCollator.get_SortKey("abc", options);
				Assert.IsNotEmpty(result);

				icuCollator.Close();
			}
		}

19. Example

Project: libpalaso
Source File: IcuRulesParserTests.cs
[Test]
		public void ValidateIcuRules_InvalidIcu_ReturnsFalse()
		{
			string message;
			Assert.IsFalse(_icuParser.ValidateIcuRules("&a < b < c(", out message));
			Assert.IsNotEmpty(message);
		}

20. Example

Project: JsonRequest
Source File: JsonRequestTests.cs
[Test]
        public void ShouldDeserializeJsonToString()
        {
            var request = new Request();
            request.Verb = "GET";
            request.URL = "http://localhost:1234/";

            var response = request.Execute();

            Console.WriteLine(response);

            Assert.IsNotNull(response);
            Assert.IsNotEmpty((string) response);
        }

21. Example

Project: JsonRequest
Source File: JsonRequestTests.cs
[Test]
        public void ShouldReceiveJsonToString()
        {
            var request = new Request();
            request.Verb = "GET";

            var response = request.Execute("http://localhost:1234/");

            Console.WriteLine(response);

            Assert.IsNotNull(response);
            Assert.IsNotEmpty((string)response);
        }

22. Example

Project: JsonRequest
Source File: JsonRequestTests.cs
[Test]
        public void ShouldDeserializePostJsonToString()
        {
            var request = new Request();

            var user = new User { username = "Bob", password = "password" };

            var response = request.Execute("http://localhost:1234/",user,"POST");

            Console.WriteLine(response);

            Assert.IsNotNull(response);
            Assert.IsNotEmpty((string)response);
        }

23. Example

Project: ContinuousTests
Source File: AssertSyntaxTests.cs
[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);
		}

24. Example

Project: ContinuousTests
Source File: AssertSyntaxTests.cs
[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);
		}

25. Example

Project: ContinuousTests
Source File: AssertSyntaxTests.cs
[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);
		}

26. Example

Project: ContinuousTests
Source File: AssertSyntaxTests.cs
[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);
		}

27. Example

Project: ContinuousTests
Source File: AssertSyntaxTests.cs
[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);
		}

28. Example

Project: NLipsum
Source File: LipsumTests.cs
[Test]
		public void TestGenerateSentences() {
			string rawText = Lipsums.LoremIpsum;
			LipsumGenerator lipsum = new LipsumGenerator(rawText, false);

			int desiredSentenceCount = 5;
			string[] generatedSentences = lipsum.
				GenerateSentences(desiredSentenceCount, Sentence.Medium);

			Assert.AreEqual(desiredSentenceCount, generatedSentences.Length, 
				"Retrieved sentence count mismatch.");

			for (int i = 0; i < desiredSentenceCount; i++) {
				Assert.IsNotNull(generatedSentences[i], 
					String.Format("Generated sentence [{0}] is null.", i));
				Assert.IsNotEmpty(generatedSentences[i]);
			}
		}

29. Example

Project: NLipsum
Source File: LipsumTests.cs
[Test]
		public void TestGenerateParagraphs() {
			string rawText = Lipsums.LoremIpsum;
			LipsumGenerator lipsum = new LipsumGenerator(rawText, false);

			int desiredParagraphCount = 5;
			string[] generatedParagraphs = lipsum.
				GenerateParagraphs(desiredParagraphCount, Paragraph.Medium);


			Assert.AreEqual(desiredParagraphCount, generatedParagraphs.Length,
				"Retrieved sentence count mismatch.");

			for (int i = 0; i < desiredParagraphCount; i++) {
				Assert.IsNotNull(generatedParagraphs[i],
					String.Format("Generated paragraph [{0}] is null.", i));
				Assert.IsNotEmpty(generatedParagraphs[i]);
			}

		}

30. Example

Project: NLipsum
Source File: LipsumTests.cs
[Test]
		public void TestGenerateHtmlNoParams() {
			string rawText = Lipsums.LoremIpsum;
			string generated = LipsumGenerator.GenerateHtml(1);

			// What can I test to make sure this is working properly?
			// Null and empty don't seem like valid tests.

			Assert.IsNotNull(generated);
			Assert.IsNotEmpty(generated);
			StringAssert.StartsWith("<p>", generated);
			StringAssert.EndsWith("</p>", generated);
		}

31. Example

Project: keepassrpc
Source File: TestJsonRpcError.cs
[ Test ]
        public void StackTraceInclusion()
        {
            ApplicationException exception = new ApplicationException();
            JsonObject error = JsonRpcError.FromException(ThrowAndCatch(exception), true);
            string trace = (string) error["stackTrace"];
            Assert.IsNotNull(trace);
            Assert.IsNotEmpty(trace);
        }

32. Example

Project: grisu.net
Source File: AssertSyntaxTests.cs
[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

Project: BreweryDB
Source File: Beers.cs
[Test()]
        public async Task GetAll()
        {
            var response = await client.Beers.GetAll();

            Assert.IsTrue(response.Status == "success");
            Assert.IsTrue(response.CurrentPage == 1);

            var beer = response.Data.FirstOrDefault(x => x.Labels != null);

            //Images
            Assert.IsTrue(beer.Labels != null);
            Assert.IsNotEmpty(beer.Labels.Large);

            //Breweries
            Assert.IsTrue(beer.Breweries != null);
        
        }

34. Example

Project: nunit-csharp-samples
Source File: AssertSyntaxTests.cs
[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);
        }

35. Example

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

36. Example

Project: Pash
Source File: AssertSyntaxTests.cs
[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: FieldWorks
Source File: TestXAmpleDLLWrapper.cs
[Test]
		public void TestParseString()
		{

			using (XAmpleDLLWrapper wrapper = CreateXAmpleDllWrapper())
			{
				LoadFilesHelper(wrapper);
				string parsedString = wrapper.ParseString("Hello");
				Assert.IsNotEmpty(parsedString);
				Assert.IsNotNull(parsedString);
			}
		}

38. Example

Project: FieldWorks
Source File: TestXAmpleDLLWrapper.cs
[Test]
		public void TestTraceString()
		{
			using (XAmpleDLLWrapper wrapper = CreateXAmpleDllWrapper())
			{
				LoadFilesHelper(wrapper);
				string tracedString = wrapper.TraceString("Hello", "Hello");
				Assert.IsNotEmpty(tracedString);
				Assert.IsNotNull(tracedString);
			}
		}

39. Example

Project: FieldWorks
Source File: TestXAmpleWrapper.cs
[Test]
		public void TestParseWord()
		{
			using (var xAmple = InitHelper())
			{
				LoadFilesHelper(xAmple);
				string parsedWord = xAmple.ParseWord("Hello");
				Assert.IsNotNull(parsedWord);
				Assert.IsNotEmpty(parsedWord);
			}
		}

40. Example

Project: FieldWorks
Source File: TestXAmpleWrapper.cs
[Test]
		public void TestTraceWord()
		{
			using (var xAmple = InitHelper())
			{
				LoadFilesHelper(xAmple);
				string tracedWord = xAmple.TraceWord("Hello", "Hello");
				Assert.IsNotNull(tracedWord);
				Assert.IsNotEmpty(tracedWord);
			}
		}

41. Example

Project: Testura.Android
Source File: UiAutomatorServerTests.cs
[Test]
        public void UiAUtomatorServer_WhenDumpingUi_ShouldGetContentBack()
        {
            _server.Start();
            var ui = _server.DumpUi();
            Assert.IsNotNull(ui);
            Assert.IsNotEmpty(ui);
        }

42. Example

Project: Aggregates.NET
Source File: BulkInvokeHandlerTerminator.cs
[Test]
        public async Task is_delayed_with_key_props_channel_different()
        {

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

43. Example

Project: pickles
Source File: when_creating_a_feature_with_meta_info_and_test_result_in_mstest_format.cs
[Test]
        public void it_should_contain_WasSuccessful_key_in_Json_document()
        {
            string content = File.ReadAllText(filePath);
            JArray jsonArray = JArray.Parse(content);

            Assert.IsNotEmpty(jsonArray[0]["Result"]["WasSuccessful"].ToString());
        }

44. Example

Project: pickles
Source File: when_creating_a_feature_with_meta_info_and_test_result_in_mstest_format.cs
[Test]
        public void it_should_WasSuccessful_false_for_feature_X_Json_document()
        {
            string content = File.ReadAllText(filePath);
            JArray jsonArray = JArray.Parse(content);

            Assert.IsNotEmpty(jsonArray[0]["Result"]["WasSuccessful"].ToString());
        }

45. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
[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);
		}

46. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
[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);
		}

47. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
[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);
		}

48. Example

Project: ScrollsModLoader
Source File: FactoryTests.cs
[Test]
        public void ShouldBeAbleToInstantiateCustomFactoryWithServiceArgumentsInConstructor()
        {
            var mock = new Mock<ISampleService>();
            var container = new ServiceContainer();
            container.LoadFromBaseDirectory("*.dll");

            container.AddService(mock.Object);
            var result = container.GetService<string>("SampleFactoryWithConstructorArguments");

            Assert.IsNotNull(result);
            Assert.IsNotEmpty(result);
        }

49. Example

Project: NLipsum
Source File: LipsumTests.cs
[Test]
		public void TestGenerateCharacters() {
			string rawText = "lorem ipsum dolor sit amet consetetur";
			int desiredCharacterCount = 10;
			string expectedText = rawText.Substring(0, desiredCharacterCount);

			LipsumGenerator lipsum = new LipsumGenerator(rawText, false);


			string[] charsRetrieved = lipsum.GenerateCharacters(desiredCharacterCount);
			
			// This should only retrieve one string
			Assert.AreEqual(1, charsRetrieved.Length);

			string generatedString = charsRetrieved[0];
			Assert.IsNotNull(generatedString);
			Assert.IsNotEmpty(generatedString);

			Assert.AreEqual(expectedText, generatedString);			

		}

50. Example

Project: JsonRequest
Source File: JsonRequestTests.cs
[Test]
        public void ShouldDeserializeJsonToObject()
        {
            var request = new Request();
            request.Verb = "GET";
            request.URL = "http://localhost:1234/";

            var response = (Httpresponse)request.Execute<Httpresponse>();

            Console.WriteLine(response.Statuscode);
            Console.WriteLine(response.Location);

            Assert.IsNotNull(response);
            Assert.IsNotEmpty(response.Statuscode.ToString());
            Assert.AreEqual(200,response.Statuscode);
        }