示例#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);
        }
        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
        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
        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);
        }