edit/revertCell (#268)

// edit/dispose -------------------------------------------------------------------------------
export interface EditDisposeParams extends IEditSessionOperationParams { }
export interface EditDisposeResult { }

* Initial plumbing for edit/revertCell

* Implementation of revert cell in the parents of the row edit base

* Adding unit tests
This commit is contained in:
Benjamin Russell
2017-03-08 14:49:13 -08:00
committed by GitHub
parent 666ee98582
commit c0468e763f
17 changed files with 469 additions and 39 deletions

View File

@@ -153,5 +153,19 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
RowDelete rd = new RowDelete(0, rs, etm);
Assert.Throws<InvalidOperationException>(() => rd.SetCell(0, null));
}
[Fact]
public void RevertCell()
{
// Setup: Create a row delete
DbColumn[] cols = Common.GetColumns(false);
ResultSet rs = Common.GetResultSet(cols, false);
IEditTableMetadata etm = Common.GetStandardMetadata(cols);
RowDelete rd = new RowDelete(0, rs, etm);
// If: I revert a cell on a delete row edit
// Then: It should throw
Assert.Throws<InvalidOperationException>(() => rd.RevertCell(0));
}
}
}