本文整理汇总了C#中Dev2.Studio.ViewModels.DataList.DataListViewModel.WriteToResourceModel方法的典型用法代码示例。如果您正苦于以下问题:C# DataListViewModel.WriteToResourceModel方法的具体用法?C# DataListViewModel.WriteToResourceModel怎么用?C# DataListViewModel.WriteToResourceModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dev2.Studio.ViewModels.DataList.DataListViewModel
的用法示例。
在下文中一共展示了DataListViewModel.WriteToResourceModel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteResourceModel_DataListContainingScalarWithError_WithDoubleBracketedScalar_Expected_Positive
public void WriteResourceModel_DataListContainingScalarWithError_WithDoubleBracketedScalar_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);
var scalarDataListItemWithError = DataListItemModelFactory.CreateDataListModel("[[Country]]", "name of Country", enDev2ColumnArgumentDirection.Both);
scalarDataListItemWithError.HasError = true;
scalarDataListItemWithError.ErrorMessage = "This is an Error";
_dataListViewModel.ScalarCollection.Add(scalarDataListItemWithError);
_dataListViewModel.ScalarCollection.Add(scalarDataListItemWithError);
_dataListViewModel.ValidateNames(scalarDataListItemWithError);
DataListSingleton.SetDataList(_dataListViewModel);
//------------Execute Test---------------------------
var xmlDataList = _dataListViewModel.WriteToResourceModel();
//------------Assert Results-------------------------
Assert.AreEqual(2, _dataListViewModel.ScalarCollection.Count);
Assert.IsTrue(_dataListViewModel.ScalarCollection[0].DisplayName == "Country");
Assert.IsTrue(_dataListViewModel.ScalarCollection[1].DisplayName == "Country");
Assert.IsFalse(xmlDataList.Contains("Country"));
}
示例2: AddRecordSetNamesIfMissing_DataListContainingRecordSet_WithRoundBracketedScalar_Expected_Positive
public void AddRecordSetNamesIfMissing_DataListContainingRecordSet_WithRoundBracketedScalar_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.WriteToResourceModel();
//------------Assert Results-------------------------
Assert.AreEqual(1, _dataListViewModel.ScalarCollection.Count);
Assert.IsTrue(_dataListViewModel.ScalarCollection[0].DisplayName == "Country");
}
示例3: CreateActiveDataListViewModel
static void CreateActiveDataListViewModel()
{
var mockResourceModel = Dev2MockFactory.SetupResourceModelMock();
var dataListViewModel = new DataListViewModel(new Mock<IEventAggregator>().Object);
dataListViewModel.InitializeDataListViewModel(mockResourceModel.Object);
dataListViewModel.RecsetCollection.Clear();
dataListViewModel.ScalarCollection.Clear();
var scalarDataListItemWithError = DataListItemModelFactory.CreateDataListModel("Country", "name of Country", enDev2ColumnArgumentDirection.Both);
var scalarDataListItemWithNoError = DataListItemModelFactory.CreateDataListModel("var", "Random Variable", enDev2ColumnArgumentDirection.Both);
scalarDataListItemWithError.HasError = true;
scalarDataListItemWithError.ErrorMessage = "This is an Error";
dataListViewModel.ScalarCollection.Add(scalarDataListItemWithError);
dataListViewModel.ScalarCollection.Add(scalarDataListItemWithNoError);
dataListViewModel.WriteToResourceModel();
DataListSingleton.SetDataList(dataListViewModel);
}