Merge pull request #273 from joncham/bug-getpid
[mono.git] / mcs / class / System.Numerics / Test / System.Numerics / ComplexTest.cs
1 // ComplexTest.cs
2 //
3 // Authors:
4 //   Christoph Ruegg <git@cdrnet.ch>
5 //
6 // Copyright (C) 2013 Novell, Inc (http://www.novell.com)
7 //
8
9 using System;
10 using System.Numerics;
11 using System.Globalization;
12 using NUnit.Framework;
13
14 namespace MonoTests.System.Numerics
15 {
16         [TestFixture]
17         public class ComplexTest
18         {
19                 [Test]
20                 public void TestToStringFormats ()
21                 {
22                         Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString (), "#1");
23                         Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ("G"), "#2");
24                         Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ((string)null), "#3");
25
26                         IFormatProvider provider = CultureInfo.InvariantCulture;
27                         Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString (provider), "#4");
28                         Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ("G", provider), "#5");
29                         Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ((string)null, provider), "#6");
30                 }
31         }
32 }