Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }