本文整理汇总了C#中Dev2.Studio.ViewModels.DataList.DataListViewModel.AddRecordsetNamesIfMissing方法的典型用法代码示例。如果您正苦于以下问题:C# DataListViewModel.AddRecordsetNamesIfMissing方法的具体用法?C# DataListViewModel.AddRecordsetNamesIfMissing怎么用?C# DataListViewModel.AddRecordsetNamesIfMissing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dev2.Studio.ViewModels.DataList.DataListViewModel
的用法示例。
在下文中一共展示了DataListViewModel.AddRecordsetNamesIfMissing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataListViewModel
public void AddRecordSetNamesIfMissing_DataListContainingRecordSet_WithSingleBracketedRecsetName_Expected_Positive()
{
//------------Setup for test--------------------------
_mockResourceModel = Dev2MockFactory.SetupResourceModelMock();
_dataListViewModel = new DataListViewModel(new Mock<IEventAggregator>().Object);
_dataListViewModel.InitializeDataListViewModel(_mockResourceModel.Object);
_dataListViewModel.RecsetCollection.Clear();
_dataListViewModel.ScalarCollection.Clear();
IDataListItemModel carRecordset = DataListItemModelFactory.CreateDataListModel("[Car]", "A recordset of information about a car", enDev2ColumnArgumentDirection.Both);
carRecordset.Children.Add(DataListItemModelFactory.CreateDataListModel("Make", "Make of vehicle", carRecordset));
carRecordset.Children.Add(DataListItemModelFactory.CreateDataListModel("Model", "Model of vehicle", carRecordset));
_dataListViewModel.RecsetCollection.Add(carRecordset);
_dataListViewModel.ScalarCollection.Add(DataListItemModelFactory.CreateDataListModel("Country", "name of Country", enDev2ColumnArgumentDirection.Both));
DataListSingleton.SetDataList(_dataListViewModel);
//------------Execute Test---------------------------
_dataListViewModel.AddRecordsetNamesIfMissing();
//------------Assert Results-------------------------
Assert.AreEqual(1, _dataListViewModel.RecsetCollection.Count);
Assert.IsTrue(_dataListViewModel.RecsetCollection[0].DisplayName == "Car()");
Assert.IsTrue(_dataListViewModel.RecsetCollection[0].Children[0].DisplayName == "Car().Make");
}