Exemple #1
0
        public void Default_ToString_With_Culture()
        {
            var sut  = new GpsLocation(5, 10);
            var text = sut.ToString(null, CultureInfo.InvariantCulture);

            text.Should().Contain(5m.ToString(null, CultureInfo.InvariantCulture));
            text.Should().Contain(10m.ToString(null, CultureInfo.InvariantCulture));
        }
Exemple #2
0
        public void Default_ToString()
        {
            var sut  = new GpsLocation(5, 10);
            var text = sut.ToString();

            text.Should().Contain(5m.ToString());
            text.Should().Contain(10m.ToString());
        }
Exemple #3
0
        public void Use_FormatString_In_ToString()
        {
            var sut  = new GpsLocation(5.5555, 10.5555);
            var text = sut.ToString("N2", CultureInfo.InvariantCulture);

            text.Should().Contain(5.5555m.ToString("N2", CultureInfo.InvariantCulture));
            text.Should().Contain(10.5555m.ToString("N2", CultureInfo.InvariantCulture));
        }
Exemple #4
0
        private void GpsdServiceOnLocationChanged(object source, GpsLocation e)
        {
            Dispatcher.Invoke(() =>
            {
                if (GpsTextBox == null)
                {
                    return;
                }
                GpsTextBox.Text = GpsTextBox.Text + e + "\n";
            });

            Console.WriteLine(e.ToString());
        }
Exemple #5
0
        public void SHOULD_serialize_ignoring_culture()
        {
            //Arrange
            var currentCulture = Thread.CurrentThread.CurrentCulture;
            var gpsLoaction    = new GpsLocation(10.11212d, 10.11212d);

            Thread.CurrentThread.CurrentCulture = new CultureInfo("de");

            //Act
            var result = gpsLoaction.ToString();

            //Assert
            Assert.That(result, Is.EqualTo("10.11212, 10.11212"));
            Thread.CurrentThread.CurrentCulture = currentCulture;
        }
Exemple #6
0
 private static void GpsdServiceOnLocationChanged(object source, GpsLocation e)
 {
     Console.WriteLine(e.ToString());
 }