本文整理汇总了C#中Dev2.Studio.ViewModels.DataList.DataListViewModel.UpdateDataListItems方法的典型用法代码示例。如果您正苦于以下问题:C# DataListViewModel.UpdateDataListItems方法的具体用法?C# DataListViewModel.UpdateDataListItems怎么用?C# DataListViewModel.UpdateDataListItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dev2.Studio.ViewModels.DataList.DataListViewModel
的用法示例。
在下文中一共展示了DataListViewModel.UpdateDataListItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataListViewModel
public void DataListViewModel_UpdateDataListItems_WithNoMissingRecsetFieldWorkflowItems_ShouldMarkRecsetFieldValueIsUsedTrue()
{
//------------Setup for test--------------------------
IResourceModel resourceModel = new Mock<IResourceModel>().Object;
var dataListViewModel = new DataListViewModel(new Mock<IEventAggregator>().Object);
dataListViewModel.InitializeDataListViewModel(resourceModel);
const string recsetName = "recset";
const string firstFieldName = "f1";
IDataListItemModel recSetDataModel = DataListItemModelFactory.CreateDataListModel(recsetName, "A recordset of information about a car", enDev2ColumnArgumentDirection.Both);
IDataListItemModel firstFieldDataListItemModel = CreateFieldDataListModel(firstFieldName, recSetDataModel);
recSetDataModel.IsUsed = false;
firstFieldDataListItemModel.IsUsed = false;
recSetDataModel.Children.Add(firstFieldDataListItemModel);
dataListViewModel.RecsetCollection.Add(recSetDataModel);
var dataListParts = new List<IDataListVerifyPart>();
var part = CreateRecsetPart(recsetName, firstFieldName);
dataListParts.Add(part.Object);
//------------Execute Test---------------------------
dataListViewModel.UpdateDataListItems(resourceModel, dataListParts);
//------------Assert Results-------------------------
Assert.IsTrue(dataListViewModel.RecsetCollection[0].Children[0].IsUsed);
}
示例2: DataListViewModel_UpdateDataListItems_DataListHasNoParts_UpdateIntellisenseMessageIsPublished
public void DataListViewModel_UpdateDataListItems_DataListHasNoParts_UpdateIntellisenseMessageIsPublished()
{
//------------Setup for test--------------------------
IResourceModel resourceModel = new Mock<IResourceModel>().Object;
Mock<IEventAggregator> eventAggregator = new Mock<IEventAggregator>();
var dataListViewModel = new DataListViewModel(eventAggregator.Object);
dataListViewModel.InitializeDataListViewModel(resourceModel);
eventAggregator.Setup(c => c.Publish(It.IsAny<UpdateIntellisenseMessage>())).Verifiable();
var dataListParts = new List<IDataListVerifyPart>();
//------------Execute Test---------------------------
dataListViewModel.UpdateDataListItems(resourceModel, dataListParts);
//------------Assert Results-------------------------
eventAggregator.Verify(c => c.Publish(It.IsAny<UpdateIntellisenseMessage>()), Times.Once());
}
示例3: DataListViewModel_UpdateDataListItems_NoMissingScalarWorkflowItems_ShouldMarkScalarValuesUsedTrue
public void DataListViewModel_UpdateDataListItems_NoMissingScalarWorkflowItems_ShouldMarkScalarValuesUsedTrue()
{
//------------Setup for test--------------------------
IResourceModel resourceModel = new Mock<IResourceModel>().Object;
var dataListViewModel = new DataListViewModel(new Mock<IEventAggregator>().Object);
dataListViewModel.InitializeDataListViewModel(resourceModel);
const string scalarName = "scalar";
var scalarItem = new DataListItemModel(scalarName) { IsUsed = false };
dataListViewModel.ScalarCollection.Add(scalarItem);
var parts = new List<IDataListVerifyPart> { CreateScalarPart(scalarName).Object };
//------------Execute Test---------------------------
dataListViewModel.UpdateDataListItems(resourceModel, parts);
//------------Assert Results-------------------------
Assert.IsTrue(dataListViewModel.ScalarCollection[0].IsUsed);
}