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)); }
public void Default_ToString() { var sut = new GpsLocation(5, 10); var text = sut.ToString(); text.Should().Contain(5m.ToString()); text.Should().Contain(10m.ToString()); }
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)); }
private void GpsdServiceOnLocationChanged(object source, GpsLocation e) { Dispatcher.Invoke(() => { if (GpsTextBox == null) { return; } GpsTextBox.Text = GpsTextBox.Text + e + "\n"; }); Console.WriteLine(e.ToString()); }
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; }
private static void GpsdServiceOnLocationChanged(object source, GpsLocation e) { Console.WriteLine(e.ToString()); }