示例#1
0
        public void EnvironmentTestsInitialize()
        {
            Monitor.Enter(DataListSingletonTestGuard);
            _aggregator = new Mock <IEventAggregator>();

            _aggregator.Setup(e => e.Publish(It.IsAny <object>())).Verifiable();
            _importServiceContext        = CompositionInitializer.InitializeMockedMainViewModel();
            ImportService.CurrentContext = _importServiceContext;

            SetupMocks();

            LayoutGrid = new LayoutGridViewModel(_aggregator.Object, _mockWebActivity.Object);

            //Mediator.DeRegisterAllActionsForMessage(MediatorMessages.RemoveUnusedDataListItems);
            //Mediator.DeRegisterAllActionsForMessage(MediatorMessages.AddMissingDataListItems);
            //Mediator.DeRegisterAllActionsForMessage(MediatorMessages.AddWorkflowDesigner);
        }
示例#2
0
        public static Mock <ILayoutObjectViewModel> LayoutObject(ILayoutGridViewModel grid, int row, int col)
        {
            Mock <ILayoutObjectViewModel> result = new Mock <ILayoutObjectViewModel>();

            result.SetupAllProperties();

            // Setup IsSelected Properties for LayoutGridObjectViewModel
            result.SetupGet(c => c.IsSelected).Returns(() => isSelected[row, col]);
            result.SetupSet(c => c.IsSelected = It.IsAny <bool>()).Callback <bool>(value => isSelected[row, col] = value);

            result.Setup(c => c.AddColumnLeftCommand);
            result.Setup(c => c.LayoutObjectGrid).Returns(grid);

            result.Setup(c => c.GridRow).Returns(row);
            result.Setup(c => c.GridColumn).Returns(col);
            result.Setup(c => c.LayoutObjectGrid).Returns(grid);
            result.Setup(c => c.CopyCommand);
            result.Setup(c => c.ClearAllCommand);

            return(result);
        }
示例#3
0
 public void CreateLayoutGrid_NullWebActivity_Expected_ArgumentNullExceptionThrown()
 {
     LayoutGrid = new LayoutGridViewModel(new Mock <IEventAggregator>().Object, null);
 }
示例#4
0
 public static ILayoutObjectViewModel LayoutObjectFromMock(ILayoutGridViewModel grid, int row, int col)
 {
     _sillyMoqResult = LayoutObject(grid, row, col).Object;
     return(_sillyMoqResult);
 }