using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Seshat; namespace Seshat.UnitTests { public class ListSegmentTests : UnitTestSharp.TestFixture { public void BasicGet() { var table = new SampleClassTable(); var row = table.NewRow(); row.triples = new int[] { 1, 2, 3 }; CheckEqual(1, row.triples[0]); CheckEqual(2, row.triples[1]); CheckEqual(3, row.triples[2]); } public void Get_NegativeIndex() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(IndexOutOfRangeException)); int x = row.triples[-1]; } public void Get_IndexTooLarge() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(IndexOutOfRangeException)); int x = row.triples[3]; } public void BasicSet() { var table = new SampleClassTable(); var row = table.NewRow(); row.triples[0] = 1; row.triples[1] = 2; row.triples[2] = 3; CheckEqual(new int[] { 1, 2, 3 }, row.triples); } public void Set_NegativeIndex() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(IndexOutOfRangeException)); row.triples[-1] = 2; } public void Set_IndexTooLarge() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(IndexOutOfRangeException)); row.triples[3] = 2; } public void IsReadOnly() { var table = new SampleClassTable(); var row = table.NewRow(); CheckFalse(row.triples.IsReadOnly); } public void IndexOf() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.IndexOf(0); } public void Insert() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.Insert(0, 0); } public void RemoveAt() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.RemoveAt(0); } public void Add() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.Add(0); } public void Clear() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.Clear(); } public void Contains() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.Contains(0); } public void CopyTo() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.CopyTo(null, 0); } public void Remove() { var table = new SampleClassTable(); var row = table.NewRow(); CheckThrow(typeof(NotImplementedException)); row.triples.Remove(0); } } }