root/trunk/eCard/eCardMVC/Platnosci.Tests/Web/StatusTest.cs @ 970

Wersja 970, 4.6 KB (wprowadzona przez marek, 16 years temu)

re #215 - dodanie nowego projektu z lepsza nazwa i typem projektu

Line 
1using adMoto.Payments.Core;
2using adMoto.Payments.Core.Data;
3using adMoto.Payments.Core.Interfaces;
4using NUnit.Framework;
5using MvcContrib.TestHelper;
6using Platnosci.Controllers;
7using System.Web.Mvc;
8
9namespace Platnosci.Tests.Web
10{
11    [TestFixture]
12    public class StatusTest
13    {
14        //[Test]
15        //[Category("Unit")]
16        //public void FormatException_Ordernumber_Test()
17        //{
18        //    IRepository<PotwierdzeniaEcard> repConfirm = new Repository<PotwierdzeniaEcard>(new FakeDataContext());
19        //    var builder = new TestControllerBuilder();
20        //    var controller = new PlatnoscController(null, null, repConfirm, null);
21        //    builder.InitializeController(controller);
22        //    builder.Form.Add("MERCHANTNUMBER", "132423");
23        //    builder.Form.Add("ORDERNUMBER", "32hvhsvhv");
24
25        //    var result = controller.Status() as ContentResult;           
26        //    System.Diagnostics.Debug.WriteLine("1. Zły formt ordernumber.");
27        //    System.Diagnostics.Debug.WriteLine("2. Count: " + repConfirm.Count());
28        //    System.Diagnostics.Debug.WriteLine("3. Contetnt: " + result.Content);
29        //    Assert.That(repConfirm.Count().Equals(0));
30        //    Assert.That(result.Content.Contains("FormatException"));
31        //}
32        //[Test]
33        //[Category("Unit")]
34        //public void FormatException_Paymenttype_Test()
35        //{
36        //    IRepository<PotwierdzeniaEcard> repConfirm = new Repository<PotwierdzeniaEcard>(new FakeDataContext());
37        //    var builder = new TestControllerBuilder();
38        //    var controller = new PlatnoscController(null, null, repConfirm, null);
39        //    builder.InitializeController(controller);
40        //    builder.Form.Add("MERCHANTNUMBER", "132423");
41        //    builder.Form.Add("PAYMENTTYPE", "32hvhsvhv");
42
43        //    var result = controller.Status() as ContentResult;
44        //    System.Diagnostics.Debug.WriteLine("Zły formt paymenttype. " + " Count: " + repConfirm.Count());
45        //    Assert.That(repConfirm.Count().Equals(0));
46        //    Assert.That(result.Content.Contains("FormatException"));
47        //}
48        //[Test]
49        //[Category("Unit")]
50        //public void FormatException_Eventtype_Test()
51        //{
52        //    IRepository<PotwierdzeniaEcard> repConfirm = new Repository<PotwierdzeniaEcard>(new FakeDataContext());
53        //    var builder = new TestControllerBuilder();
54        //    var controller = new PlatnoscController(null, null, repConfirm, null);
55        //    builder.InitializeController(controller);
56        //    builder.Form.Add("MERCHANTNUMBER", "132423");
57        //    builder.Form.Add("EVENTTYPE", "32hvhsvhv");
58
59        //    var result = controller.Status() as ContentResult;
60        //    System.Diagnostics.Debug.WriteLine("Zły formt eventtype. " + " Count: " + repConfirm.Count());
61        //    Assert.That(repConfirm.Count().Equals(0));
62        //    Assert.That(result.Content.Contains("FormatException"));
63        //}
64        //[Test]
65        //[Category("Unit")]
66        //public void OverflowException_Ordernumber_Test()
67        //{
68        //    var controller = new PlatnoscController();
69        //    var builder = new TestControllerBuilder();
70        //    builder.InitializeController(controller);
71        //    builder.Form.Add("MERCHANTNUMBER", "132");
72        //    builder.Form.Add("ORDERNUMBER", "12311111111111111");
73        //    builder.Form.Add("VALIDATIONCODE", "AAA");
74           
75        //    var result = controller.Status() as ContentResult;
76        //    System.Diagnostics.Debug.WriteLine("1. Wartosc ordernumber jest za duza.");
77        //    System.Diagnostics.Debug.WriteLine("2. Contetnt: " + result.Content);
78        //    Assert.That(result.Content.Contains("OverflowException"));
79        //}
80        //[Test]
81        //[Category("Unit")]
82        //public void IncorrectLength_Validationcode_Test()
83        //{
84        //    var controller = new PlatnoscController();
85        //    var builder = new TestControllerBuilder();
86        //    builder.InitializeController(controller);
87        //    builder.Form.Add("MERCHANTNUMBER", "132");
88        //    builder.Form.Add("ORDERNUMBER", "1234");
89        //    builder.Form.Add("VALIDATIONCODE", "AAAaaa");
90           
91        //    var result = controller.Status() as ContentResult;
92        //    System.Diagnostics.Debug.WriteLine("1. Validationcode jest zbyt dlugi. Conajwyzej 3 znaki.");
93        //    System.Diagnostics.Debug.WriteLine("2. Contetnt: " + result.Content);
94        //    Assert.That(result.Content.Contains("SqlException"));
95        //}
96    }
97}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.