public void AddId_Values() { datalist.AddId(row, new TestModel { Id = "Test" }); KeyValuePair <String, String> actual = row.Single(); Assert.Equal(MvcDatalist.IdKey, actual.Key); Assert.Equal("Test", actual.Value); }
public void AddId_EmptyValues() { TestDatalist <NoIdModel> testDatalist = new TestDatalist <NoIdModel>(); testDatalist.AddId(row, new NoIdModel()); KeyValuePair <String, String> actual = row.Single(); Assert.Equal(MvcDatalist.IdKey, actual.Key); Assert.Null(actual.Value); }
public void AddId_FromFunction() { TestDatalist <NoIdModel> testDatalist = new TestDatalist <NoIdModel>(); testDatalist.Id = (model) => "1"; testDatalist.AddId(row, new NoIdModel()); KeyValuePair <String, String> actual = row.Single(); Assert.Equal(MvcDatalist.IdKey, actual.Key); Assert.Equal("1", actual.Value); }
public void AddId_EmptyValues() { TestDatalist<NoIdModel> datalist = new TestDatalist<NoIdModel>(); datalist.AddId(row, new NoIdModel()); KeyValuePair<String, String> actual = row.Single(); Assert.Equal(MvcDatalist.IdKey, actual.Key); Assert.Null(actual.Value); }