예제 #1
0
        public void Pop_IncrementsCurrentPositionByLengthOfStreamElements_WhenStreamElementsAreLongerThanOne()
        {
            var stream = new StringStream();

            stream.Append("as").Append("asd");

            stream.Pop();
            stream.Pop();
            var result = stream.CurrentPosition;

            Assert.AreEqual(5, result);
        }
        protected override Task <Stream> OpenStreamAsync()
        {
            if (!manager.IsProviderEnabled(LocationManager.GpsProvider))
            {
                throw new InvalidOperationException("The GPS Location Provider is not enabled");
            }

            stream                = new StringStream();
            listener              = new Listener();
            listener.NmeaMessage += (s, e) => stream?.Append(e);
            bool success = manager.AddNmeaListener(listener);

            manager.RequestLocationUpdates(LocationManager.GpsProvider, 0, 0f, listener);
            return(Task.FromResult <Stream>(stream));
        }