SetupDataListViewModel() public static method

public static SetupDataListViewModel ( ) : Mock
return Mock
        public void SetDataList_Expected_CurrentDataListSetInSingleton()
        {
            Mock <IDataListViewModel> mockdataListViewModel = Dev2MockFactory.SetupDataListViewModel();

            DataListSingleton.SetDataList(mockdataListViewModel.Object);
            Assert.AreEqual(DataListSingleton.ActiveDataList, mockdataListViewModel.Object);
        }
Beispiel #2
0
        public void LoadInputAutoMappingInputOutputViewModelNullRecordSet_Expected_InputOutputViewModelValueNotSet()
        {
            _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);
            IInputOutputViewModel     actual;
            Mock <IDataListViewModel> dataListVM = Dev2MockFactory.SetupDataListViewModel();

            dataListVM.Setup(c => c.DataList).Returns(ReturnDefaultDataListViewModel(dataListVM.Object, false));
            actual = _autoMappingInputAction.LoadInputAutoMapping(_mockInputOutputViewModel.Object);
            _mockInputOutputViewModel.VerifySet(dmVM => dmVM.Value = It.IsAny <string>(), Times.Never());
        }
        public void UpdateActiveDataList_Expected_NewActiveDataList()
        {
            Mock <IDataListViewModel> mockdataListViewModel = Dev2MockFactory.SetupDataListViewModel();

            DataListSingleton.SetDataList(mockdataListViewModel.Object);
            Mock <IDataListViewModel> mock_newDataListViewModel = new Mock <IDataListViewModel>();

            mock_newDataListViewModel.Setup(dataList => dataList.Resource).Returns(Dev2MockFactory.SetupResourceModelMock().Object);
            DataListSingleton.SetDataList(mock_newDataListViewModel.Object);
            Assert.AreNotEqual(DataListSingleton.ActiveDataList, mockdataListViewModel);
        }
Beispiel #4
0
        public void LoadInputAutoMappingInputOutputViewModelScalarValue_Expected_ReturnedItemThatWasPassedInForInputMapping()
        {
            _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);

            IInputOutputViewModel expected = _mockInputOutputViewModel.Object;
            IInputOutputViewModel actual;

            _mockInputOutputViewModel.Setup(c => c.Value).Returns(string.Empty);

            Mock <IDataListViewModel> mockDataListViewModel = Dev2MockFactory.SetupDataListViewModel();

            mockDataListViewModel.Setup(dlVM => dlVM.DataList).Returns(ReturnDefaultDataListViewModel(mockDataListViewModel.Object, false, "InputOutputTestDisplayName"));
            mockDataListViewModel.Setup(dlVM => dlVM.ScalarCollection).Returns(ReturnDefaultDataListViewModel(mockDataListViewModel.Object, false, "InputOutputTestDisplayName"));
            mockDataListViewModel.Setup(dlVM => dlVM.RecsetCollection).Returns(new OptomizedObservableCollection <IDataListItemModel>());

            DataListSingleton.SetDataList(mockDataListViewModel.Object);

            actual = _autoMappingInputAction.LoadInputAutoMapping(_mockInputOutputViewModel.Object);
            _mockInputOutputViewModel.VerifySet(input => input.Value = It.IsAny <string>(), Times.Exactly(1), "Input View Model failed to set to DataList Representation value");
        }