public void TryParse_should_not_move_offset_on_invalid_input()
        {
            var offset = 1;

            PropertiesFragment.TryParse(" %d", ref offset);

            offset.Should().Be(1);
        }
        public void TryParse_should_move_offset_accordingly()
        {
            var offset = 1;

            PropertiesFragment.TryParse(" %p", ref offset);

            offset.Should().Be(3);
        }
예제 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                View mContentView = Window.DecorView;
                var  uiOptions    = (int)mContentView.SystemUiVisibility;
                var  newUiOptions = (int)uiOptions;

                newUiOptions |= (int)SystemUiFlags.Fullscreen;
                newUiOptions |= (int)SystemUiFlags.HideNavigation;
                mContentView.SystemUiVisibility = (StatusBarVisibility)newUiOptions;

                Window.AddFlags(WindowManagerFlags.Fullscreen);

                SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base);

                // Create your application here
                SetContentView(Resource.Layout.edit_image_layout);

                PathImage = Intent.GetStringExtra("PathImage") ?? "";
                IdImage   = Intent.GetStringExtra("IdImage") ?? "0";

                InitComponent();
                SetRecyclerViewAdapters();
                InitNiceArtEditor();

                //Color
                MPropertiesFragment = new PropertiesFragment(MNiceArtEditor);
                MPropertiesFragment.SetPropertiesChangeListener(this);

                //Emojis
                MEmojisFragment = new EmojisFragment(MNiceArtEditor);

                //Sticker
                MStickerFragment = new StickerFragment(MNiceArtEditor);

                if ((int)Build.VERSION.SdkInt < 23)
                {
                    Methods.Path.Chack_MyFolder();
                }
                else
                {
                    RequestPermissions(new string[]
                    {
                        Manifest.Permission.ReadExternalStorage,
                        Manifest.Permission.WriteExternalStorage,
                        Manifest.Permission.Camera,
                    }, 10);
                }

                if (!string.IsNullOrEmpty(PathImage))
                {
                    SetImageNiceArt(Uri.Parse(PathImage));
                }

                AdsGoogle.Ad_Interstitial(this);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public void TryParse_should_be_case_insensitive()
        {
            var offset = 1;

            PropertiesFragment.TryParse(" %P", ref offset).Should().NotBeNull();
        }
        public void TryParse_should_return_null_on_invalid_input(string input)
        {
            var offset = 1;

            PropertiesFragment.TryParse(input, ref offset).Should().BeNull();
        }
        public void TryParse_should_parse_fragment()
        {
            var offset = 1;

            PropertiesFragment.TryParse(" %p", ref offset).Should().Be(new PropertiesFragment());
        }