Adding EditCell constructor validation (#301)

* New unit tests!
* New CopyTo method!
* New null validation!

YEAH!!!
This commit is contained in:
Benjamin Russell
2017-04-03 13:20:04 -07:00
committed by GitHub
parent 65456ae35b
commit e548ae67b5
4 changed files with 119 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
//
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.EditData.Contracts
{
@@ -24,11 +25,10 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.Contracts
/// <param name="isDirty">Whether or not the edit cell is dirty</param>
public EditCell(DbCellValue dbCellValue, bool isDirty)
{
IsDirty = isDirty;
Validate.IsNotNull(nameof(dbCellValue), dbCellValue);
dbCellValue.CopyTo(this);
DisplayValue = dbCellValue.DisplayValue;
IsNull = dbCellValue.IsNull;
RawObject = dbCellValue.RawObject;
IsDirty = isDirty;
}
/// <summary>