コード例 #1
0
        public void TestAsAllGeneric()
        {
            string str = null;

            // test null check
            CollectionAssert.IsEmpty(Adapters.AsAll <object>(str));
            CollectionAssert.IsEmpty(str.AsAll <object>());

            // test handling non-IDecoratable
            str = "a";
            Utilities.TestSequenceEqual(Adapters.AsAll <string>(str), str);
            Utilities.TestSequenceEqual(str.AsAll <string>(), str);

            // test IDecoratable calls
            SimpleDecoratable test;

            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(Adapters.AsAll <string>(test), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(test.AsAll <string>(), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
        }
コード例 #2
0
        public void TestAsAll()
        {
            string str = null;

            // test null check
            CollectionAssert.IsEmpty(str.AsAll(typeof(object)));
            CollectionAssert.IsEmpty(str.AsAll(typeof(object)));

            // test handling non-IDecoratable
            str = "a";
            Utilities.TestSequenceEqual(str.AsAll(typeof(string)), str);
            Utilities.TestSequenceEqual(str.AsAll(typeof(string)), str);

            // test IDecoratable calls
            SimpleDecoratable test;

            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(test.AsAll(typeof(string)), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(test.AsAll(typeof(string)), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
        }
コード例 #3
0
ファイル: TestAdapters.cs プロジェクト: Joxx0r/ATF
        public void TestAsAllGeneric()
        {
            string str = null;

            // test null check
            CollectionAssert.IsEmpty(Adapters.AsAll<object>(str));
            CollectionAssert.IsEmpty(str.AsAll<object>());

            // test handling non-IDecoratable
            str = "a";
            Utilities.TestSequenceEqual(Adapters.AsAll<string>(str), str);
            Utilities.TestSequenceEqual(str.AsAll<string>(), str);

            // test IDecoratable calls
            SimpleDecoratable test;
            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(Adapters.AsAll<string>(test), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(test.AsAll<string>(), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
        }
コード例 #4
0
ファイル: TestAdapters.cs プロジェクト: sbambach/ATF
        public void TestAsAll()
        {
            string str = null;

            // test null check
            CollectionAssert.IsEmpty(str.AsAll(typeof(object)));
            CollectionAssert.IsEmpty(str.AsAll(typeof(object)));

            // test handling non-IDecoratable
            str = "a";
            Utilities.TestSequenceEqual(str.AsAll(typeof(string)), str);
            Utilities.TestSequenceEqual(str.AsAll(typeof(string)), str);

            // test IDecoratable calls
            SimpleDecoratable test;
            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(test.AsAll(typeof(string)), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
            test = new SimpleDecoratable();
            Utilities.TestSequenceEqual(test.AsAll(typeof(string)), SimpleDecoratable.Decorators);
            Assert.True(test.AsAllCalled);
        }