当前位置: 首页>>代码示例>>C#>>正文


C# DataListViewModel.WriteToResourceModel方法代码示例

本文整理汇总了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"));
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:32,代码来源:DataListViewModelTests.cs

示例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");
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:26,代码来源:DataListViewModelTests.cs

示例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);
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:18,代码来源:DefaultIntellisenseProviderTest.cs


注:本文中的Dev2.Studio.ViewModels.DataList.DataListViewModel.WriteToResourceModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。