DuplicateArrayTestTest.cs 1.1 KB

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