コード例 #1
0
        public void UnBoxIt()
        {
            var boxing = new BoxPractice();
            var result = boxing.UnBoxIt((object)1);

            Assert.IsTrue(result == 1);
        }
コード例 #2
0
        public void BoxIt()
        {
            var boxing = new BoxPractice();
            var result = boxing.BoxIt(1);

            Assert.IsTrue(result.GetType() == typeof(int));
        }
コード例 #3
0
        public void RandomUnBoxItList()
        {
            var boxing = new BoxPractice();
            var result = boxing.RandomUnBoxItList(new List <object> {
                1, 2, 3, 4, 5, "aa", "bb", "cc"
            });

            Assert.IsTrue(result.Count() == 3 && result.Last() == "cc");
        }
コード例 #4
0
        public void UnBoxItList()
        {
            var boxing = new BoxPractice();
            var result = boxing.UnBoxItList(new List <object> {
                1, 2, 3, 4, 5
            });

            Assert.IsTrue(result.Count() == 5 && result.Last() == 5);
        }
コード例 #5
0
        public void BoxItList()
        {
            var boxing = new BoxPractice();
            var result = boxing.BoxItList(new List <int> {
                1, 2, 3, 4, 5
            });

            Assert.IsTrue(result.Count() == 5);
        }
コード例 #6
0
        public void RandomBoxItList()
        {
            var boxing = new BoxPractice();
            var result = boxing.RandomBoxItList(new List <int> {
                1, 2, 3, 4, 5
            }, new List <string> {
                "aa", "bb", "cc"
            });

            Assert.IsTrue(result.Count() == 8);
        }