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

2. Example

View license
public static void ShouldNotBeEmpty(this string aString)
        {
            Assert.IsNotEmpty(aString);
        }

3. Example

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

4. Example

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

5. Example

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

6. Example

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

7. Example

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

8. Example

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

9. Example

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

10. Example

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

11. Example

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

12. Example

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

13. Example

View license
public static void ShouldNotBeEmpty(this string aString)
    {
        Assert.IsNotEmpty(aString);
    }

14. Example

Project: NLipsum
Source File: LipsumTests.cs
View license
[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
View license
[Test]
		public void Indexer()
		{
			foreach (string plug in Env.Current.CommunicationPlugins.PluginIds)
			{
				Assert.IsNotEmpty(plug);
				Assert.IsNotNull(Env.Current.CommunicationPlugins[plug]);
			}
		}

16. Example

View license
[Test]
        public void Should_include_a_string()
        {
            Assert.IsNotEmpty(_values.StringValue);
            Assert.AreEqual("Hello", _values.StringValue);
        }

17. Example

View license
[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();
			}
		}

18. Example

Project: Jayrock
Source File: TestJsonRpcError.cs
View license
[ 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);
        }

19. Example

Project: JsonRequest
Source File: JsonRequestTests.cs
View license
[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);
        }

20. Example

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

21. Example

Project: JsonRequest
Source File: JsonRequestTests.cs
View license
[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);
        }

22. Example

Project: JsonRequest
Source File: JsonRequestTests.cs
View license
[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

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);
        }

24. 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);
		}

25. 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);
		}

26. 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);
		}

27. 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);
		}

28. 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);
		}

29. 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);
		}

30. 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);
		}

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 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());
        }

33. Example

View license
[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());
        }

34. Example

View license
[Test]
        public async Task is_delayed_with_key_props_channel_different()
        {

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

35. Example

Project: NLipsum
Source File: LipsumTests.cs
View license
[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]);
			}
		}

36. Example

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

37. Example

Project: nunit
Source File: ConditionAssertTests.cs
View license
[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));
        }

38. 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);
		}

39. Example

Project: BreweryDB
Source File: Beers.cs
View license
[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);
        
        }

40. 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);
		}

41. Example

Project: keepassrpc
Source File: TestJsonRpcError.cs
View license
[ 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);
        }

42. Example

View license
[Test]
        public void UiAUtomatorServer_WhenDumpingUi_ShouldGetContentBack()
        {
            _server.Start();
            var ui = _server.DumpUi();
            Assert.IsNotNull(ui);
            Assert.IsNotEmpty(ui);
        }

43. Example

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

44. Example

Project: FieldWorks
Source File: TestXAmpleDLLWrapper.cs
View license
[Test]
		public void TestParseString()
		{

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

45. Example

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

46. Example

Project: NLipsum
Source File: LipsumTests.cs
View license
[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]);
			}

		}

47. Example

Project: NLipsum
Source File: LipsumTests.cs
View license
[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);
		}

48. Example

Project: ScrollsModLoader
Source File: FactoryTests.cs
View license
[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
View license
[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
View license
[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);
        }