NUnit.Framework.Assert.IsNotNullOrEmpty(string, string)

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

6 Examples 7

1. Example

View license
public void Initialize(LcmCache cache, ICmObject obj, int flid, string fieldName, string analysisWs)
		{
			Assert.IsNotNull(obj, "Must initialize with an object and flid.");
			Assert.Greater(flid, 0, "Must initialize with an object and flid.");
			Assert.IsNotNullOrEmpty(fieldName, "Must initialize with a field name.");
			Initialize(cache, obj, flid, fieldName, null, null, null, "", analysisWs);
		}

2. Example

View license
public void Initialize(LcmCache cache, ICmObject obj, int flid, string fieldName, string analysisWs)
		{
			Assert.IsNotNull(obj, "Must initialize with an object and flid.");
			Assert.Greater(flid, 0, "Must initialize with an object and flid.");
			Assert.IsNotNullOrEmpty(fieldName, "Must initialize with a field name.");
			Initialize(cache, obj, flid, fieldName, null, null, null, "", analysisWs);
		}

3. Example

Project: xenadmin
Source File: AddHostCommandTest.cs
View license
public void Test()
        {
            foreach (SelectedItemCollection selection in RunTest(() =&g/n ..... /n //View Source file for more details /n }

4. Example

View license
[TestCase("NUnit", "http://localhost")]
        public async void GetAuthorizationCode_WhenGivenValidClientIdAndRedirectUri_ShouldReturnValidResponse(string clientId, string redirectUri)
        {
            string code;

            // Get authorization code
            using (var browser = new BrowserSession())
            {
                browser.Visit($"{this.client.BaseAddress}oauth/authorize?response_type=code&client_id={clientId}&state=&scope={Constants.Scope.Read}&redirect_uri={redirectUri}");

                Console.WriteLine("Opened authorize page");

                browser.FillIn("Username").With("user");
                browser.FillIn("Password").With("user");
                browser.ClickButton("Login");

                Console.WriteLine("Signing in");
                browser.HasContent("The application NUnit wants to access your account", new Options() { RetryInterval = TimeSpan.FromSeconds(1) });

                browser.ClickButton("Allow");

                Console.WriteLine("Accepting authorization");
                await Task.Delay(TimeSpan.FromSeconds(5));

                var uri = browser.Location;
                Console.WriteLine("Query String: {0}", uri.Query);

                Assert.Contains("code", uri.ParseQueryString().AllKeys);

                code = uri.ParseQueryString()["code"];
            }

            Assert.IsNotNullOrEmpty(code, "No authorization code returned");
        }

5. Example

Project: MimeKit
Source File: MultipartRelatedTests.cs
View license
[Test]
		public void TestDocumentRoot ()
		{
			var gif = new MimePart ("image", "gif") { ContentDis/n ..... /n //View Source file for more details /n }

6. Example

Project: MimeKit
Source File: MultipartTests.cs
View license
[Test]
		public void TestBasicFunctionality ()
		{
			var multipart = new Multipart ();

			Assert.IsNotNullOrEmpty (multipart.Boundary, "Boundary");
			Assert.IsFalse (multipart.IsReadOnly, "IsReadOnly");

			multipart.Boundary = "__Next_Part_123";

			Assert.AreEqual ("__Next_Part_123", multipart.Boundary);

			var generic = new MimePart ("application", "octet-stream") { ContentObject = new ContentObject (new MemoryStream ()), IsAttachment = true };
			var plain = new TextPart ("plain") { Text = "This is some plain text." };

			multipart.Add (generic);
			multipart.Insert (0, plain);

			Assert.AreEqual (2, multipart.Count, "Count");

			Assert.IsTrue (multipart.Contains (generic), "Contains");
			Assert.AreEqual (0, multipart.IndexOf (plain), "IndexOf");
			Assert.IsTrue (multipart.Remove (generic), "Remove");
			Assert.IsFalse (multipart.Remove (generic), "Remove 2nd time");

			multipart.RemoveAt (0);

			Assert.AreEqual (0, multipart.Count, "Count");

			multipart.Add (generic);
			multipart.Add (plain);

			Assert.AreEqual (generic, multipart[0]);
			Assert.AreEqual (plain, multipart[1]);

			multipart[0] = plain;
			multipart[1] = generic;

			Assert.AreEqual (plain, multipart[0]);
			Assert.AreEqual (generic, multipart[1]);

			multipart.Clear ();

			Assert.AreEqual (0, multipart.Count, "Count");
		}