public void ListEntityBase_Add() { TestEntity entity = new TestEntity(); int index = entity.Add(2); Assert.Equal(0, index); Assert.Single(entity.InnerList); Assert.Equal(2, entity.InnerList[0]); index = entity.Add("test"); Assert.Equal(1, index); Assert.Equal(2, entity.InnerList.Count); Assert.Equal(2, entity.InnerList[0]); Assert.Equal("test", entity.InnerList[1]); }
public void ListEntityBase_Add_FixedSize() { TestEntity entity = new TestEntity { IsFixedSize = true }; Assert.Throws <NotSupportedException>(() => entity.Add(2)); }