Exemple #1
0
        public void SetUp()
        {
            scaleGridToggleBehaviourMock_     = Substitute.For <IToggleButtonBehaviour>();
            directionGridToggleBehaviourMock_ = Substitute.For <IToggleButtonBehaviour>();
            equatorToggleBehaviourMock_       = Substitute.For <IToggleButtonBehaviour>();
            scaleGridToggleButtonMock_        = Substitute.For <IToggleButton>();
            directionGridToggleButtonMock_    = Substitute.For <IToggleButton>();
            equatorGridToggleButtonMock_      = Substitute.For <IToggleButton>();
            consoleBehaviourMock_             = Substitute.For <IConsoleBehaviour>();
            gridBehaviourMock_            = Substitute.For <IGridBehaviour>();
            componentFactoryMock_         = Substitute.For <IComponentFactory>();
            scaleCircleBehaviourMock_     = Substitute.For <IVisible>();
            directionCircleBehaviourMock_ = Substitute.For <IVisible>();
            equatorCircleBehaviourMock_   = Substitute.For <IVisible>();
            pureDataFacadeMock_           = Substitute.For <IPureDataFacade>();

            consoleBehaviourMock_.ScaleGridToggleBehaviour.Returns(scaleGridToggleBehaviourMock_);
            consoleBehaviourMock_.DirectionGridToggleBehaviour.Returns(directionGridToggleBehaviourMock_);
            consoleBehaviourMock_.EquatorToggleBehaviour.Returns(equatorToggleBehaviourMock_);

            componentFactoryMock_.CreateToggleButton(scaleGridToggleBehaviourMock_).Returns(scaleGridToggleButtonMock_);
            componentFactoryMock_.CreateToggleButton(directionGridToggleBehaviourMock_).Returns(directionGridToggleButtonMock_);
            componentFactoryMock_.CreateToggleButton(equatorToggleBehaviourMock_).Returns(equatorGridToggleButtonMock_);

            gridBehaviourMock_.ScaleCircleBehaviour.Returns(scaleCircleBehaviourMock_);
            gridBehaviourMock_.DirectionCircleBehaviour.Returns(directionCircleBehaviourMock_);
            gridBehaviourMock_.FFTCircleBehaviour.Returns(equatorCircleBehaviourMock_);

            console_ = new Console(consoleBehaviourMock_, gridBehaviourMock_, pureDataFacadeMock_, componentFactoryMock_);
        }
Exemple #2
0
        public Console(IConsoleBehaviour consoleBehaviour, IGridBehaviour gridBehaviour, IPureDataFacade pureDataFacade,
                       IComponentFactory componentFactory = null)
        {
            consoleBehaviour_ = consoleBehaviour;
            gridBehaviour_    = gridBehaviour;
            componentFactory  = componentFactory ?? new ComponentFactory();

            var scaleGridToggleButton = componentFactory.CreateToggleButton(consoleBehaviour.ScaleGridToggleBehaviour);

            scaleGridToggleButton.ButtonStateChanged += OnScaleGridButtonTouched;

            var directionGridToggleButton = componentFactory.CreateToggleButton(consoleBehaviour.DirectionGridToggleBehaviour);

            directionGridToggleButton.ButtonStateChanged += OnDirectionGridButtonTouched;

            var equatorToggleButton = componentFactory.CreateToggleButton(consoleBehaviour.EquatorToggleBehaviour);

            equatorToggleButton.ButtonStateChanged += OnEquatorButtonTouched;

            pureDataFacade.LevelChanged += OnLevelChanged;
        }