コード例 #1
0
ファイル: StringTests.cs プロジェクト: standardfx/standard
        public void NotEmptyTest()
        {
            string actual = "afds";

            SAssert.NotEmpty(actual);
            SAssert.NotEmpty(null);

            XAssert.Throws <ArgumentException>(() => SAssert.NotEmpty(string.Empty));
        }
コード例 #2
0
        public void EmptyArrayTest()
        {
            int[] a = new int[] { 1, 2, 3 };
            int[] b = new int[] { };

            SAssert.NotEmpty(a);
            XAssert.Throws <ArgumentException>(() => SAssert.NotEmpty(b));

            SAssert.Empty(b);
            XAssert.Throws <ArgumentException>(() => SAssert.Empty(a));
        }
コード例 #3
0
        public void EmptyListTest()
        {
            List <string> a = new List <string>();

            a.Add("foo");
            List <string> b = new List <string>();

            SAssert.NotEmpty(a);
            XAssert.Throws <ArgumentException>(() => SAssert.NotEmpty(b));

            SAssert.Empty(b);
            XAssert.Throws <ArgumentException>(() => SAssert.Empty(a));
        }
コード例 #4
0
        public void EmptyDictionaryTest()
        {
            Dictionary <string, string> a = new Dictionary <string, string>();

            a.Add("foo", "bar");
            Dictionary <string, string> b = new Dictionary <string, string>();

            SAssert.NotEmpty(a);
            XAssert.Throws <ArgumentException>(() => SAssert.NotEmpty(b));

            SAssert.Empty(b);
            XAssert.Throws <ArgumentException>(() => SAssert.Empty(a));
        }