public void AddActionLink_NoKey_Throws() { IGrid <Object> grid = new Grid <Object>(new Object[0]); IGridColumns <Object> columns = new GridColumns <Object>(grid); columns.Grid.HttpContext = HttpContextFactory.CreateHttpContextBase(); IGridColumn <Object> column = columns.AddActionLink("Delete", "fa fa-times"); String actual = Assert.Throws <Exception>(() => column.ValueFor(new GridRow(new Object()))).Message; String expected = "Object type does not have a key property."; Assert.Equal(expected, actual); }
public void AddActionLink_NoKey_Throws() { IGrid <Object> grid = new Grid <Object>(new Object[0]); IGridColumnsOf <Object> columns = new GridColumns <Object>(grid); columns.Grid.ViewContext = new ViewContext { HttpContext = Substitute.For <HttpContext>() }; IGridColumn <Object> column = columns.AddActionLink("Delete", "fa fa-times"); String actual = Assert.Throws <Exception>(() => column.ValueFor(new GridRow <Object>(new Object()))).Message; String expected = "Object type does not have a key property."; Assert.Equal(expected, actual); }