Example #1
0
        public void TestDraw2(bool isChecked)
        {
            var view = new Mock <ICheckBox>();

            view.Setup(x => x.IsChecked).Returns(isChecked);
            var canvas   = new Mock <ICanvas>();
            var drawable = new CheckBoxDrawable(view.Object);

            Assert.Equal(isChecked, view.Object.IsChecked);

            var exception = Record.Exception(() =>
            {
                drawable.Draw(canvas.Object, new RectF(0, 0, 100, 100));
            });

            Assert.Null(exception);
        }
Example #2
0
        public void TestDraw(bool isEnabled, string text)
        {
            var view = new Mock <ICheckBox>();

            view.Setup(x => x.Text).Returns(text);
            var canvas   = new Mock <ICanvas>();
            var drawable = new CheckBoxDrawable(view.Object);

            drawable.IsEnabled = isEnabled;
            Assert.Equal(isEnabled, drawable.IsEnabled);

            var exception = Record.Exception(() =>
            {
                drawable.Draw(canvas.Object, new RectF(0, 0, 100, 100));
            });

            Assert.Null(exception);
        }