Esempio n. 1
0
        public void In_Use_With_Description_Does_Request()
        {
            var bundle = new TestBundle
                {
                    RequriesBackgroundLocation = false,
                    InUseLocationReason = "reason"
                };

            var manager = new VerfyAuthorizeLocationManager();
            manager.RequestAuthorization(bundle);
            Assert.Equal(CLAuthorizationStatus.AuthorizedWhenInUse, manager.RequestedStatus);
        }
Esempio n. 2
0
        public void Background_With_Description_Does_Not_Throw()
        {
            var bundle = new TestBundle
                {
                    RequriesBackgroundLocation = true,
                    BackgroundLocationReason = "reason"
                };

            var manager = new VerfyAuthorizeLocationManager();
            manager.RequestAuthorization(bundle);
            Assert.Equal(CLAuthorizationStatus.AuthorizedAlways, manager.RequestedStatus);
        }
Esempio n. 3
0
        public void In_Use_With_Description_Does_Request()
        {
            var bundle = new TestBundle
            {
                RequriesBackgroundLocation = false,
                InUseLocationReason        = "reason"
            };

            var manager = new VerfyAuthorizeLocationManager();

            manager.RequestAuthorization(bundle);
            Assert.Equal(CLAuthorizationStatus.AuthorizedWhenInUse, manager.RequestedStatus);
        }
Esempio n. 4
0
        public void Background_With_Description_Does_Not_Throw()
        {
            var bundle = new TestBundle
            {
                RequriesBackgroundLocation = true,
                BackgroundLocationReason   = "reason"
            };

            var manager = new VerfyAuthorizeLocationManager();

            manager.RequestAuthorization(bundle);
            Assert.Equal(CLAuthorizationStatus.AuthorizedAlways, manager.RequestedStatus);
        }
Esempio n. 5
0
        public void In_Use_With_No_Description_Throws()
        {
            var bundle = new TestBundle
                {
                    RequriesBackgroundLocation = false
                };

            var manager = new VerfyAuthorizeLocationManager();
            Assert.Throws<InvalidOperationException>(() =>
                manager.RequestAuthorization(bundle)
            );
            Assert.Equal(CLAuthorizationStatus.NotDetermined, manager.RequestedStatus);
        }
Esempio n. 6
0
        public void In_Use_With_No_Description_Throws()
        {
            var bundle = new TestBundle
            {
                RequriesBackgroundLocation = false
            };

            var manager = new VerfyAuthorizeLocationManager();

            Assert.Throws <InvalidOperationException>(() =>
                                                      manager.RequestAuthorization(bundle)
                                                      );
            Assert.Equal(CLAuthorizationStatus.NotDetermined, manager.RequestedStatus);
        }