Example #1
0
        public void DataReference()
        {
            IEntity entity = new ContentEntity(0, "");

            entity.AddData <DataInt>().A = 1;

            DataReference <DataInt> reference = CreateDataReference <DataInt>(entity);

            Assert.Equal(1, reference.Current().A);
            Assert.Equal(1, reference.Current <DataInt>().A);
            Assert.Throws <InvalidOperationException>(() => reference.Current <DataEmpty>());
        }