Пример #1
0
        public void IsZero_1()
        {
            TEditor testClass = new TEditor();

            testClass.WriteString("14/3");
            Assert.IsFalse(testClass.IsZero());
        }
Пример #2
0
        public void IsZero_2()
        {
            TEditor testClass = new TEditor();

            testClass.WriteString("0/11");
            Assert.IsTrue(testClass.IsZero());
        }
Пример #3
0
        public void IsZero_2()
        {
            TEditor testClass = new TEditor();

            testClass.WriteNumber("0,+i*0,");
            Assert.IsTrue(testClass.IsZero());
        }
Пример #4
0
        public void IsZero_1()
        {
            TEditor testClass = new TEditor();

            testClass.WriteNumber("12,36+i*12,35");
            Assert.IsFalse(testClass.IsZero());
        }
Пример #5
0
        void Init(Context context)
        {
            _richTextEditor = new TEditor();

            this.SetWebViewClient(new TEditorWebViewClient(_richTextEditor));
            this.SetWebChromeClient(new TEditorChromeWebClient());
            _richTextEditor.SetJavaScriptEvaluatingFunction((input) =>
            {
                this.EvaluateJavascript(input, null);
            });
            _richTextEditor.SetJavaScriptEvaluatingWithResultFunction((input) =>
            {
                var activity            = context as Activity;
                JavaScriptResult result = new JavaScriptResult();
                this.EvaluateJavascript(input, result);
                if (activity != null)
                {
                    activity.RunOnUiThread(() =>
                    {
                    });
                }
                return(result.GetResultAsync());
            });
            _colorPickerDialog = new ColorPickerDialog(context, Color.Red);
            _colorPickerDialog.ColorChanged += (o, args) =>
            {
                _richTextEditor.SetTextColor((int)args.Color.R, (int)args.Color.G, (int)args.Color.B);
            };

            _richTextEditor.LaunchColorPicker = () =>
            {
                _colorPickerDialog.Show();
            };
            this.LoadResource();
        }
Пример #6
0
        public void Init_And_Output_1()
        {
            TEditor testClass = new TEditor();
            string  output    = "10,3+i*0,8";

            testClass.WriteNumber(output);
            Assert.AreEqual(output, testClass.ReadNumber());
        }
Пример #7
0
        public void IsZeroGood()
        {
            TEditor edit     = new TEditor();
            bool    expected = true;
            bool    result   = edit.IsZero();

            Assert.AreEqual(expected, result);
        }
Пример #8
0
        public void ConstructurZeroGood()
        {
            TEditor edit     = new TEditor();
            string  expected = "0,0";
            string  result   = edit.GetNumber();

            Assert.AreEqual(expected, result);
        }
Пример #9
0
        public void ConstructurNumberBCFail()
        {
            TEditor edit     = new TEditor("16,3", 1, 1);
            string  expected = "0,0";
            string  result   = edit.GetNumber();

            Assert.AreEqual(expected, result);
        }
Пример #10
0
        public void ClearGood()
        {
            TEditor edit     = new TEditor("16,3", 16, 1);
            string  expected = "0,0";
            string  result   = edit.Clear();

            Assert.AreEqual(expected, result);
        }
Пример #11
0
        public void AddSignoGood()
        {
            TEditor edit     = new TEditor("16,16", 16, 2);
            string  expected = "-16,16";
            string  result   = edit.AddSign();

            Assert.AreEqual(expected, result);
        }
Пример #12
0
        public void AddZeroGood()
        {
            TEditor edit     = new TEditor("16,0", 16, 1);
            string  expected = "160,0";
            string  result   = edit.AddZero();

            Assert.AreEqual(expected, result);
        }
Пример #13
0
        public void ConstructurNumberBCGood()
        {
            TEditor edit     = new TEditor("16,16", 16, 2);
            string  expected = "16,16";
            string  result   = edit.GetNumber();

            Assert.AreEqual(expected, result);
        }
Пример #14
0
        public void Init_And_Output_2()
        {
            TEditor testClass = new TEditor();
            string  output    = "-12,6-i*66,2";

            testClass.WriteNumber(output);
            Assert.AreEqual(output, testClass.ReadNumber());
        }
Пример #15
0
        public void ClearFail()
        {
            TEditor edit     = new TEditor("0,0", 16, 1);
            string  expected = "0,0";
            string  result   = edit.BackSpace();

            Assert.AreEqual(expected, result);
        }
Пример #16
0
        public void SetNumberFail()
        {
            TEditor edit     = new TEditor("110,0", 10, 1);
            string  expected = "110,0";
            string  result   = edit.SetNumber("1A,2B");

            Assert.AreEqual(expected, result);
        }
Пример #17
0
        public void BackSpaceFail()
        {
            TEditor edit     = new TEditor("-16,3345", 16, 4);
            string  expected = "-16,334";
            string  result   = edit.BackSpace();

            Assert.AreEqual(expected, result);
        }
Пример #18
0
        public void AddZeroFail()
        {
            TEditor edit     = new TEditor("-16,3", 16, 1);
            string  expected = "-16,3";
            string  result   = edit.AddZero();

            Assert.AreEqual(expected, result);
        }
Пример #19
0
        public void IsZeroFail()
        {
            TEditor edit     = new TEditor("16,3", 16, 1);
            bool    expected = false;
            bool    result   = edit.IsZero();

            Assert.AreEqual(expected, result);
        }
Пример #20
0
        public void GetNumberGood()
        {
            TEditor edit     = new TEditor("16,3", 16, 1);
            string  expected = "16,3";
            string  result   = edit.GetNumber();

            Assert.AreEqual(expected, result);
        }
Пример #21
0
        public void BackSpaceGood()
        {
            TEditor edit     = new TEditor("16,3", 16, 1);
            string  expected = "16,0";
            string  result   = edit.BackSpace();

            Assert.AreEqual(expected, result);
        }
Пример #22
0
        static void Main(string[] args)
        {
            TEditor edit     = new TEditor("110,0", 13, 1);
            string  expected = "110,0";
            string  result   = edit.SetNumber("1A,2B");

            Console.WriteLine(result);
        }
Пример #23
0
        public void Init_And_Output_1()
        {
            TEditor testClass = new TEditor();
            string  output    = "3/4";

            testClass.WriteString(output);
            Assert.AreEqual(output, testClass.ReadString());
        }
Пример #24
0
        public void AddNumber_2()
        {
            TEditor testClass = new TEditor();

            testClass.WriteNumber("-25,6-i*44,44");
            testClass.AddNumber(0);
            string output = "-250,6-i*44,44";

            Assert.AreEqual(output, testClass.ReadNumber());
        }
Пример #25
0
        public void DelNumber_1()
        {
            TEditor testClass = new TEditor();

            testClass.WriteString("42/3");
            testClass.DelSymbol();
            string output = "42/3";

            Assert.AreEqual(output, testClass.ReadString());
        }
Пример #26
0
        public void AddNumber_2()
        {
            TEditor testClass = new TEditor();

            testClass.WriteString("0/1");
            testClass.AddNumber(4);
            string output = "4/1";

            Assert.AreEqual(output, testClass.ReadString());
        }
Пример #27
0
        public void ToggleMinus_2()
        {
            TEditor testClass = new TEditor();

            testClass.WriteString("-3/4");
            testClass.ToggleMinus();
            string output = "3/4";

            Assert.AreEqual(output, testClass.ReadString());
        }
Пример #28
0
        public void ToggleMinus_2()
        {
            TEditor testClass = new TEditor();

            testClass.WriteNumber("-12,36+i*12,35");
            testClass.ToggleMinus();
            string output = "12,36+i*12,35";

            Assert.AreEqual(output, testClass.ReadNumber());
        }
Пример #29
0
        public void AddNumber_1()
        {
            TEditor testClass = new TEditor();

            testClass.WriteNumber("0,36+i*1,4");
            testClass.AddNumber(4);
            string output = "4,36+i*1,4";

            Assert.AreEqual(output, testClass.ReadNumber());
        }
Пример #30
0
        public void Clear()
        {
            TEditor testClass = new TEditor();

            testClass.WriteString("42/34");
            testClass.Clear();
            string output = "0/1";

            Assert.AreEqual(output, testClass.ReadString());
        }