Exemple #1
0
        public static void TestIsReadOnly()
        {
            var array = new Eina.Array <int>();

            int[] tmp = { 1, 3, 2, 6, 5 };
            array.Append(tmp);
            Test.AssertEquals(array.Count, 5);
            array.SetOwnership(false);
            Test.AssertRaises <NotSupportedException>(() => array.Add(4));
            Test.AssertRaises <NotSupportedException>(() => array.Push(6));
            Test.AssertRaises <NotSupportedException>(() => array.Append(tmp));
            Test.AssertEquals(array.Count, 5);
            Test.AssertRaises <NotSupportedException>(() => array.DataSet(2, 4));
            Test.Assert(array.ToArray().SequenceEqual(tmp));
        }