String UI for writing to a string variable.
Наследование: IUI, INotifyPropertyChanged
 // Functions
 /// <summary>
 /// Default constructor setting up simulator.
 /// 
 /// Note: Edits Factory->Simulator.
 /// </summary>
 public SimulatorViewModel()
 {
     //_sim = Factory.currentIRobotInstance;
     suiSimulatorUI = new StringUI();
     Factory.getSimulatorInstance.IUIOutput = suiSimulatorUI;
     _sim = Factory.getSimulatorInstance;
 }
Пример #2
0
        public void StringUI_WriteLine_BufferAreSame()
        {
            StringUI _stringUI = new StringUI();
            object[] Array = new[] { "1", "2" };

            _stringUI.writeLine("Hello {0}", Array);
            _stringUI.writeLine("Hello {1}", Array);

            Assert.AreEqual("* Hello 1\r\n* Hello 2\r\n", _stringUI.Buffer);
        }
Пример #3
0
        public void StringUI_WriteLine_ThenClear_BufferIsEmpty()
        {
            StringUI _stringUI = new StringUI();

            object[] Array = new[] { "1", "2" };

            _stringUI.writeLine("Hello {0}", Array);
            _stringUI.writeLine("Hello {1}", Array);

            _stringUI.clearString();

            Assert.IsEmpty(_stringUI.Buffer);
        }
Пример #4
0
        public void StringUI_ProportyChanged()
        {
            StringUI _stringUI = new StringUI();

            PropertyChangedEventHandler _propertyChanged = (sender, e) => Assert.AreEqual("Buffer", e.PropertyName);

            _stringUI.PropertyChanged += _propertyChanged;

            object[] Array = new[] { "1", "2" };

            _stringUI.writeLine("Hello {0}", Array);

            Assert.AreEqual("* Hello 1\r\n", _stringUI.Buffer);
        }
Пример #5
0
 public void StringUI_Constructor_Test()
 {
     StringUI _stringUI = new StringUI();
     Assert.IsEmpty(_stringUI.Buffer);
 }