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 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); }
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 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 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"); }