public void NotInitialLoadOutputAutoMappingTest() { _autoMappingOutputAction = new AutoMappingOutputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object); IInputOutputViewModel expected = _mockInputOutputViewModel.Object; IInputOutputViewModel actual; actual = _autoMappingOutputAction.LoadOutputAutoMapping(_mockInputOutputViewModel.Object); Assert.AreEqual(expected, actual); }
public void LoadOutputputAutoMappingInputOutputViewModelNullRecordSet_Expected_InputOutputViewModelValueNotSet() { _autoMappingOutputAction = new AutoMappingOutputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object); IInputOutputViewModel actual; Mock <IDataListViewModel> dataListVM = Dev2MockFactory.SetupDataListViewModel(); dataListVM.Setup(c => c.DataList).Returns(ReturnDefaultDataListViewModel(dataListVM.Object, false)); dataListVM.Setup(c => c.DataList).Returns(ReturnDefaultDataListViewModel(dataListVM.Object, false)); actual = _autoMappingOutputAction.LoadOutputAutoMapping(_mockInputOutputViewModel.Object); _mockInputOutputViewModel.VerifySet(dmVM => dmVM.Value = It.IsAny <string>(), Times.Never()); }
public void LoadOutputAutoMappingInputOutputViewModelScalarValue_Expected_ReturnedItemThatWasPassedInForInputMapping() { _autoMappingOutputAction = new AutoMappingOutputAction(_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 = _autoMappingOutputAction.LoadOutputAutoMapping(_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 AutoMappingOutputActionConstructorTest() { _autoMappingOutputAction = new AutoMappingOutputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object); }
public void IsInitialLoadOutputAutoMappingTest() { _autoMappingOutputAction = new AutoMappingOutputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object); IInputOutputViewModel expected = _mockInputOutputViewModel.Object; IInputOutputViewModel actual; actual = _autoMappingOutputAction.LoadOutputAutoMapping(_mockInputOutputViewModel.Object); Assert.AreEqual(expected, actual); }
public void AutoMappingOutputActionConstructorTest() { _autoMappingOutputAction = new AutoMappingOutputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object); }
public void LoadOutputputAutoMappingInputOutputViewModelNullRecordSet_Expected_InputOutputViewModelValueNotSet() { _autoMappingOutputAction = new AutoMappingOutputAction(_mockDataMappingViewModel.Object, _mockWebActivity.Object); IInputOutputViewModel actual; Mock<IDataListViewModel> dataListVM = Dev2MockFactory.SetupDataListViewModel(); dataListVM.Setup(c => c.DataList).Returns(ReturnDefaultDataListViewModel(dataListVM.Object, false)); dataListVM.Setup(c => c.DataList).Returns(ReturnDefaultDataListViewModel(dataListVM.Object, false)); actual = _autoMappingOutputAction.LoadOutputAutoMapping(_mockInputOutputViewModel.Object); _mockInputOutputViewModel.VerifySet(dmVM => dmVM.Value = It.IsAny<string>(), Times.Never()); }
public void LoadOutputAutoMapping_InputOutViewModelRecordSetValue_Expected_ItemValuePopulatedWithRecordSetName() { _autoMappingOutputAction = new AutoMappingOutputAction(_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 = _autoMappingOutputAction.LoadOutputAutoMapping(_mockInputOutputViewModel.Object); _mockInputOutputViewModel.VerifySet(input => input.Value = It.IsAny<string>(), Times.Exactly(1), "Input View Model failed to set to DataList Representation value"); }