0241fa44c08158756e65d8433ed619b1796f2f2d
[mono.git] / mcs / class / System.Web.Services / Test / standalone / client / localhost / DuplicateArrayTestTest.cs
1 // Web service test for WSDL document:
2 // http://localhost:8080/DuplicateArrayTest.asmx?wsdl
3
4 using System;
5 using NUnit.Framework;
6 using DuplicateArrayTestTests.Soap;
7
8 namespace Localhost.DuplicateArrayTestTests
9 {
10         [TestFixture]
11         public class DuplicateArrayTestTest: WebServiceTest
12         {
13                 [Test]
14                 public void TestService ()
15                 {
16                         DuplicateArrayTest s = new DuplicateArrayTest();
17
18                         string  title = "hello";
19                         string  url = "tmp";
20                         correctionsCorrection c = new correctionsCorrection();
21                         c.word = "bye";
22                         c.suggestions = new string[]{"end","test"};
23                         correctionsCorrection[] arr = new correctionsCorrection[2]{c,c};
24                         arr = s.SpellCheck(ref title,ref url,arr);
25                         
26                         Assert.AreEqual (2, arr.Length, "t1");
27                         
28                         for (int i =0; i< arr.Length ; i++)
29                         {
30                                 c = arr[i];
31                                 Assert.IsNotNull (c, "t2."+i);
32                                 Assert.AreEqual ("bye", c.word, "t3."+i);
33                                 Assert.IsNotNull (c.suggestions, "t4."+i);
34                                 Assert.AreEqual (2, c.suggestions.Length, "t5."+i);
35                                 Assert.AreEqual ("end", c.suggestions[0], "t6."+i);
36                                 Assert.AreEqual ("test", c.suggestions[1], "t7."+i);
37                         }
38                         Assert.AreEqual ("hello", title, "t8");
39                         Assert.AreEqual ("tmp", url, "t9");
40                 }
41         }
42 }