Example #1
0
        /// <summary>
        /// Constructs a new EditCell based on a DbCellValue
        /// </summary>
        /// <param name="dbCellValue">The DbCellValue that will be enhanced</param>
        /// <param name="isDirty">Whether or not the edit cell is dirty</param>
        public EditCell(DbCellValue dbCellValue, bool isDirty)
        {
            Validate.IsNotNull(nameof(dbCellValue), dbCellValue);
            dbCellValue.CopyTo(this);

            IsDirty = isDirty;
        }
        public void CopyToValid()
        {
            // If: I copy a DbCellValue to another DbCellValue
            DbCellValue source = new DbCellValue {
                DisplayValue = "qqq", IsNull = true, RawObject = 12
            };
            DbCellValue dest = new DbCellValue();

            source.CopyTo(dest);

            // Then: The source values should be in the dest
            Assert.Equal(source.DisplayValue, dest.DisplayValue);
            Assert.Equal(source.IsNull, dest.IsNull);
            Assert.Equal(source.RawObject, dest.RawObject);
        }