Esempio n. 1
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());
        }
Esempio n. 2
0
        public void NotInitialLoadInputAutoMappingTest()
        {
            _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);

            IInputOutputViewModel expected = _mockInputOutputViewModel.Object;
            IInputOutputViewModel actual;

            actual = _autoMappingInputAction.LoadInputAutoMapping(_mockInputOutputViewModel.Object);
            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void IsInitialLoadInputAutoMapping_Expected_ReturnedItemThatWasPassedInForInputMapping()
        {
            _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);

            IInputOutputViewModel expected = _mockInputOutputViewModel.Object;
            IInputOutputViewModel actual;

            actual = _autoMappingInputAction.LoadInputAutoMapping(_mockInputOutputViewModel.Object);
            Assert.AreEqual(expected, actual);
        }
Esempio n. 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");
        }
 public void AutoMappingInputActionConstructor_Expected_AutoMappingActionCreatedThatCanBeExecuted() {
  
     _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);
     Assert.IsTrue(_autoMappingInputAction.CanExecute());
 }
        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 NotInitialLoadInputAutoMappingTest() {          
            _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);

            IInputOutputViewModel expected = _mockInputOutputViewModel.Object;
            IInputOutputViewModel actual;
            actual = _autoMappingInputAction.LoadInputAutoMapping(_mockInputOutputViewModel.Object);
            Assert.AreEqual(expected, actual);
        }
        public void LoadInputAutoMapping_InputOutViewModelRecordSetValue_Expected_ItemValuePopulatedWithRecordSetName() {
            _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, true, "InputOutputTestDisplayName"));
            mockDataListViewModel.Setup(dlVM => dlVM.ScalarCollection).Returns(ReturnDefaultDataListViewModel(mockDataListViewModel.Object, true, "InputOutputTestDisplayName"));
            mockDataListViewModel.Setup(dlVM => dlVM.RecsetCollection).Returns(new OptomizedObservableCollection<IDataListItemModel>());

            DataListSingleton.SetDataList(mockDataListViewModel.Object);

            _mockInputOutputViewModel.SetupGet(c => c.RecordSetName).Returns("InputOutputTestDisplayName");


            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");
        }
        public void IsInitialLoadInputAutoMapping_Expected_ReturnedItemThatWasPassedInForInputMapping() {        
            _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);

            IInputOutputViewModel expected = _mockInputOutputViewModel.Object;
            IInputOutputViewModel actual;
            actual = _autoMappingInputAction.LoadInputAutoMapping(_mockInputOutputViewModel.Object);
            Assert.AreEqual(expected, actual);
        }
Esempio n. 10
0
 public void AutoMappingInputActionConstructor_Expected_AutoMappingActionCreatedThatCanBeExecuted()
 {
     _autoMappingInputAction = new AutoMappingInputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object);
     Assert.IsTrue(_autoMappingInputAction.CanExecute());
 }