public void ReturnParameter_OrThrowIfNullOrEmpty_Collection_Ok()
        {
            var testColl = new List <int> {
                1, 2, 3
            };

            Assert.DoesNotThrow(() => ReturnParameter.OrThrowIfNullOrEmpty(testColl, "list"));
            Assert.That(ReturnParameter.OrThrowIfNullOrEmpty(testColl, "list"), Is.EqualTo(testColl));
        }
Exemple #2
0
 public void ReturnParameter_OrThrowIfNullOrEmpty_Ok()
 {
     Assert.DoesNotThrow(() => ReturnParameter.OrThrowIfNullOrEmpty("helloWorld", "testString"));
     Assert.AreEqual(ReturnParameter.OrThrowIfNullOrEmpty("helloWorld", "testString"), "helloWorld");
 }
Exemple #3
0
        public void ReturnParameter_OrThrowIfNullOrEmpty_Empty()
        {
            var x = Assert.Throws <ArgumentException>(() => ReturnParameter.OrThrowIfNullOrEmpty(string.Empty, "testString"));

            Assert.That(x.Message, Does.StartWith("Value should not be empty"));
        }
Exemple #4
0
 public void ReturnParameter_OrThrowIfNullOrEmpty_Null()
 {
     Assert.Throws <ArgumentNullException>(() => ReturnParameter.OrThrowIfNullOrEmpty(null, "testString"));
 }
        public void ReturnParameter_OrThrowIfNullOrEmpty_Collection_Empty()
        {
            var x = Assert.Throws <ArgumentException>(() => ReturnParameter.OrThrowIfNullOrEmpty(new List <int>(), "list"));

            Assert.That(x.Message, Does.StartWith("Collection should not be empty"));
        }
 public void ReturnParameter_OrThrowIfNullOrEmpty_Collection_Null()
 {
     Assert.Throws <ArgumentNullException>(() => ReturnParameter.OrThrowIfNullOrEmpty(null, "list"));
 }