Example #1
0
 public void WhenSomeValuesAreNullOrEmpty()
 {
     Assert.Throws <DbcException>(() => Dbc.NotNullOrEmpty(new string[] { "", "foo" }));
     Assert.Throws <DbcException>(() => Dbc.NotNullOrEmpty(new string[] { "foo", null }));
 }
Example #2
0
 public void WhenACollectionIsNotEmpty()
 {
     Assert.DoesNotThrow(() => Dbc.NotNullOrEmpty(new int[] { 1 }, "some message"));
 }
Example #3
0
 public void WhenAValueIsNotEmpty()
 {
     Assert.DoesNotThrow(() => Dbc.NotNullOrEmpty("foo", "some message"));
 }
Example #4
0
 public void WhenAValueIsEmptyCollection()
 {
     Assert.Throws <DbcException>(() => Dbc.NotNullOrEmpty(new List <int>()));
     Assert.Throws <DbcException>(() => Dbc.NotNullOrEmpty(new int[] {}));
 }
Example #5
0
 public void WhenAValueIsEmptyString()
 {
     Assert.Throws <DbcException>(() => Dbc.NotNullOrEmpty(""));
 }
Example #6
0
 public void WhenAValueIsNull()
 {
     Assert.Throws <DbcException>(() => Dbc.NotNullOrEmpty((string)null));
 }