コード例 #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());
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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");
        }
コード例 #5
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());
        }
コード例 #6
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);
        }
コード例 #7
0
        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");
        }
コード例 #8
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);
        }