public void AddedDataIsNotContainedRuntime() { IEntity entity = EntityTestHelpers.CreateRuntimeEntity(); entity.AddData <DataEmpty>(); Assert.False(entity.ContainsData <DataEmpty>()); Assert.Throws <NoSuchDataException>(() => entity.Current <DataEmpty>()); }
public void InitializingReturnsOneConstantInstanceRuntime() { IEntity entity = EntityTestHelpers.CreateRuntimeEntity(); DataEmpty data0 = entity.AddData <DataEmpty>(); DataEmpty data1 = entity.AddOrModify <DataEmpty>(); DataEmpty data2 = entity.Modify <DataEmpty>(); Assert.ReferenceEquals(data0, data1); Assert.ReferenceEquals(data0, data2); }
public void RemovedDataIsNotReturnedInSelectData() { RuntimeEntity entity = EntityTestHelpers.CreateRuntimeEntity(); entity.AddData <DataEmpty>(); entity.DataStateChangeUpdate(); Assert.Equal(1, entity.SelectData().Count); entity.RemoveData <DataEmpty>(); Assert.Equal(1, entity.SelectData().Count); entity.DataStateChangeUpdate(); Assert.Equal(0, entity.SelectData().Count); }