Esempio n. 1
0
        public void FirstIndexOf_miss_Test()
        {
            var list = new HasAnInt[]
            {
                new HasAnInt {
                    Integer = 12
                },
                new HasAnInt {
                    Integer = 23
                },
                new HasAnInt {
                    Integer = 34
                },
                new HasAnInt {
                    Integer = 23
                },
                new HasAnInt {
                    Integer = 12
                },
            };

            int x = list.FirstIndexOf(_x => _x.Integer == 234);

            Assert.AreEqual(-1, x);
        }
Esempio n. 2
0
        public void Object_JoinAsString_stringizer_Test()
        {
            var list = new HasAnInt[]
            {
                new HasAnInt {
                    Integer = 42
                },
                new HasAnInt {
                    Integer = 23
                },
            };

            var joined = list.JoinAsString(",", _obj => $"({_obj.Integer * 2})");

            Assert.AreEqual("(84),(46)", joined);
        }
Esempio n. 3
0
        public void Object_JoinAsString_Test()
        {
            var list = new HasAnInt[]
            {
                new HasAnInt {
                    Integer = 42
                },
                new HasAnInt {
                    Integer = 23
                },
            };

            var joined = list.JoinAsString(" ");

            Assert.AreEqual("[42] [23]", joined);
        }