本文整理汇总了C#中Dev2.Studio.ViewModels.DataList.DataListViewModel.ValidateNames方法的典型用法代码示例。如果您正苦于以下问题:C# DataListViewModel.ValidateNames方法的具体用法?C# DataListViewModel.ValidateNames怎么用?C# DataListViewModel.ValidateNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dev2.Studio.ViewModels.DataList.DataListViewModel
的用法示例。
在下文中一共展示了DataListViewModel.ValidateNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataListViewModel_HasErrors_ItemHasInvalidChar_ErrorNotRemovedFromDuplicateCheck
public void DataListViewModel_HasErrors_ItemHasInvalidChar_ErrorNotRemovedFromDuplicateCheck()
{
//------------Setup for test--------------------------
var dataListViewModel = new DataListViewModel();
IDataListItemModel dataListItemModel = new DataListItemModel("[email protected]");
dataListItemModel.HasError = true;
dataListItemModel.ErrorMessage = StringResources.ErrorMessageInvalidChar;
dataListViewModel.ScalarCollection.Add(dataListItemModel);
//------------Execute Test---------------------------
dataListViewModel.ValidateNames(dataListItemModel);
//------------Assert Results-------------------------
Assert.IsTrue(dataListViewModel.HasErrors);
StringAssert.Contains(dataListViewModel.DataListErrorMessage, dataListItemModel.ErrorMessage);
}
示例2: 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"));
}
示例3: DataListViewModel_ValidateNames_ItemHasInvalidChar_ErrorNotRemovedFromDuplicateCheck
public void DataListViewModel_ValidateNames_ItemHasInvalidChar_ErrorNotRemovedFromDuplicateCheck()
{
//------------Setup for test--------------------------
var dataListViewModel = new DataListViewModel();
IDataListItemModel dataListItemModel = new DataListItemModel("[email protected]");
dataListItemModel.HasError = true;
dataListItemModel.ErrorMessage = StringResources.ErrorMessageInvalidChar;
//------------Execute Test---------------------------
dataListViewModel.ValidateNames(dataListItemModel);
//------------Assert Results-------------------------
Assert.AreEqual(StringResources.ErrorMessageInvalidChar, dataListItemModel.ErrorMessage);
}