示例#1
0
        public void AreNullOrEmptyTest()
        {
            string[] arrayWithNull    = { "asd", null, "asd" };
            string[] arrayWithoutNull = { "asd", "ddd", "asd" };

            Assert.IsTrue(CommonHelper.AreNullOrEmpty(arrayWithNull));
            Assert.IsFalse(CommonHelper.AreNullOrEmpty(arrayWithoutNull));
        }
示例#2
0
        public void CanEnsureStringsAreNullOrEmpty()
        {
            // Ensure the checker can identify null or empty strings
            CommonHelper.AreNullOrEmpty("", "b", "c").ShouldBeTrue();
            CommonHelper.AreNullOrEmpty("a", string.Empty, "c").ShouldBeTrue();
            CommonHelper.AreNullOrEmpty("a", "b", null).ShouldBeTrue();

            // Ensure the checker handles valid strings as well
            CommonHelper.AreNullOrEmpty("a", "b", "c").ShouldBeFalse();
        }