Zbiór zmian 970 dla trunk/eCard/eCardMVC/Platnosci.Tests/Web
- Data:
- 2009-12-23 11:26:06 (16 years ago)
- Lokalizacja:
- trunk/eCard/eCardMVC/Platnosci.Tests/Web
- Pliki:
-
- 10 zmodyfikowane
-
FakeDataContext.cs (zmodyfikowane) (2 diffs)
-
FakeTranslation.cs (zmodyfikowane) (1 diff)
-
Function.cs (zmodyfikowane) (3 diffs)
-
FunkcjePlatnosciTests.cs (zmodyfikowane) (1 diff)
-
MerchantControllerTests.cs (zmodyfikowane) (3 diffs)
-
PlatnosciControllerTests.cs (zmodyfikowane) (10 diffs)
-
StatusTest.cs (zmodyfikowane) (2 diffs)
-
TestMethods.cs (zmodyfikowane) (2 diffs)
-
ValidationMerchantClassTests.cs (zmodyfikowane) (1 diff)
-
eCardDataTests.cs (zmodyfikowane) (2 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/Platnosci.Tests/Web/FakeDataContext.cs
r951 r970 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using Platnosci.Core.Interface;5 using Platnosci.Core.Linq;4 using adMoto.Payments.Core.Data; 5 using adMoto.Payments.Core.Interfaces; 6 6 7 7 namespace Platnosci.Tests.Web … … 47 47 { 48 48 } 49 public IQueryable< vPlatnosciEcard> FindInvoiceByNipNumber(string nip, string numer)49 public IQueryable<Invoice> FindInvoiceByNipNumber(string nip, string numer) 50 50 { 51 51 throw new NotImplementedException(); -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/FakeTranslation.cs
r931 r970 1 using Platnosci.Core.Interface;1 using adMoto.Payments.Core.Interfaces; 2 2 3 3 namespace Platnosci.Tests.Web 4 4 { 5 public class FakeTranslation : ITranslateManager5 public class FakeTranslation : ITranslateManager 6 6 { 7 7 public string Translate(string className, string keyName) -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/Function.cs
r957 r970 1 1 using System; 2 using Platnosci.Core.Linq; 2 using adMoto.Payments.Core; 3 using adMoto.Payments.Core.Data; 3 4 using System.Web.Mvc; 4 5 using Moq; … … 8 9 public class Function 9 10 { 10 public vPlatnosciEcardCreateInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy)11 public Invoice CreateInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy) 11 12 { 12 var platnosc = new vPlatnosciEcard();13 var platnosc = new Invoice(); 13 14 platnosc.ID_faktury = id; 14 15 platnosc.nip = nip; … … 19 20 return platnosc; 20 21 } 21 public vPlatnosciEcardCreateForeignInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy, decimal walutaBrutto, string currency)22 public Invoice CreateForeignInvoice(int id, string nip, string invoiceNumber, decimal brutto, byte systemKsiegowy, decimal walutaBrutto, string currency) 22 23 { 23 var platnosc = new vPlatnosciEcard();24 var platnosc = new Invoice(); 24 25 platnosc.ID_faktury = id; 25 26 platnosc.nip = nip; -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/FunkcjePlatnosciTests.cs
r969 r970 1 1 using System.Linq; 2 using adMoto.Payments.Core; 3 using adMoto.Payments.Core.Data; 4 using adMoto.Payments.Core.Interfaces; 2 5 using NUnit.Framework; 3 6 using Platnosci.Models; 4 using Platnosci.Core.Linq;5 using Platnosci.Core.Interface;6 7 7 8 8 namespace Platnosci.Tests.Web -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/MerchantControllerTests.cs
r969 r970 1 using NUnit.Framework; 2 using Platnosci.Core.Linq; 3 using Platnosci.Core.Interface; 1 using adMoto.Payments.Core; 2 using adMoto.Payments.Core.Data; 3 using adMoto.Payments.Core.Interfaces; 4 using NUnit.Framework; 4 5 using Platnosci.Controllers; 5 6 using Platnosci.Models; … … 19 20 { 20 21 //Arrange 21 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());22 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip1", "", 0, 0);22 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 23 var platnosc = _function.CreateInvoice(123, "nip1", "", 0, 0); 23 24 repVPayment.Insert(platnosc); 24 25 25 Payer payer = _function.CreatePayer(123, "test", "test");26 var payer = _function.CreatePayer(123, "test", "test"); 26 27 27 28 var controller = new MerchantController(repVPayment, null, _translateManager); … … 42 43 { 43 44 //Arrange 44 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());45 v PlatnosciEcardplatnosc = _function.CreateInvoice(12, "nip1", "", 0, 0);45 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 46 var platnosc = _function.CreateInvoice(12, "nip1", "", 0, 0); 46 47 repVPayment.Insert(platnosc); 47 48 48 Payer payer = _function.CreatePayer(123, "test", "test");49 var payer = _function.CreatePayer(123, "test", "test"); 49 50 50 51 var controller = new MerchantController(repVPayment, null, _translateManager); -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/PlatnosciControllerTests.cs
r969 r970 1 1 using System; 2 using System.Linq;3 2 using System.Web.Mvc; 4 3 using adMoto.Payments.Core; 4 using adMoto.Payments.Core.Data; 5 using adMoto.Payments.Core.Interfaces; 5 6 using NUnit.Framework; 6 using MvcContrib.TestHelper;7 7 using Platnosci.Controllers; 8 9 using Platnosci.Core.Interface;10 using Platnosci.Core.Linq;11 8 using Platnosci.Models; 12 9 … … 141 138 { 142 139 //Arrange 143 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());140 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 144 141 var platnosc = _function.CreateInvoice(123, "nip1", "", 0, 0); 145 142 repVPayment.Insert(platnosc); … … 162 159 { 163 160 //Arrange 164 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());165 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip2", "", 0, 0);161 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 162 var platnosc = _function.CreateInvoice(123, "nip2", "", 0, 0); 166 163 repVPayment.Insert(platnosc); 167 164 … … 185 182 //Arrange 186 183 //Tworzymy takie dane aby platnosc o danym id byla juz zaplacona 187 var repVPayment = new Repository< vPlatnosciEcard>(new FakeDataContext());184 var repVPayment = new Repository<Invoice>(new FakeDataContext()); 188 185 var invoice = _function.CreateInvoice(123, "nip1", "aaa", 0, 0); 189 186 repVPayment.Insert(invoice); … … 212 209 { 213 210 //Arrange 214 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());215 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0);211 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 212 var platnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0); 216 213 repVPayment.Insert(platnosc); 217 214 … … 240 237 { 241 238 //Arrange 242 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());243 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0);239 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 240 var platnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0); 244 241 repVPayment.Insert(platnosc); 245 242 … … 261 258 { 262 259 //Arrange 263 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());264 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0);260 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 261 var platnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0); 265 262 repVPayment.Insert(platnosc); 266 263 … … 282 279 { 283 280 //Arrange 284 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());285 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0);286 repVPayment.Insert(platnosc); 287 288 var controller = new PlatnoscController(repVPayment, null, null, _translateManager); 289 controller.ControllerContext = _function.CreateControllerContext("nip1"); 290 stringname = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";291 Payer payer = _function.CreatePayer(123, name, "test");281 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 282 var platnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0); 283 repVPayment.Insert(platnosc); 284 285 var controller = new PlatnoscController(repVPayment, null, null, _translateManager); 286 controller.ControllerContext = _function.CreateControllerContext("nip1"); 287 var name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; 288 var payer = _function.CreatePayer(123, name, "test"); 292 289 293 290 //Act … … 303 300 { 304 301 //Arrange 305 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());306 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0);307 repVPayment.Insert(platnosc); 308 309 var controller = new PlatnoscController(repVPayment, null, null, _translateManager); 310 controller.ControllerContext = _function.CreateControllerContext("nip1"); 311 stringsurname = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";312 Payer payer = _function.CreatePayer(123, "test", surname);302 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 303 var platnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0); 304 repVPayment.Insert(platnosc); 305 306 var controller = new PlatnoscController(repVPayment, null, null, _translateManager); 307 controller.ControllerContext = _function.CreateControllerContext("nip1"); 308 var surname = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; 309 var payer = _function.CreatePayer(123, "test", surname); 313 310 314 311 //Act … … 324 321 { 325 322 //Arrange 326 IRepository< vPlatnosciEcard> repVPayment = new Repository<vPlatnosciEcard>(new FakeDataContext());327 v PlatnosciEcardplatnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0);323 IRepository<Invoice> repVPayment = new Repository<Invoice>(new FakeDataContext()); 324 var platnosc = _function.CreateInvoice(123, "nip1", "numer", 200, 0); 328 325 repVPayment.Insert(platnosc); 329 326 -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/StatusTest.cs
r969 r970 1 using NUnit.Framework; 2 using Platnosci.Core.Linq; 3 using Platnosci.Core.Interface; 1 using adMoto.Payments.Core; 2 using adMoto.Payments.Core.Data; 3 using adMoto.Payments.Core.Interfaces; 4 using NUnit.Framework; 4 5 using MvcContrib.TestHelper; 5 6 using Platnosci.Controllers; … … 11 12 public class StatusTest 12 13 { 13 [Test]14 [Category("Unit")]15 public void FormatException_Ordernumber_Test()16 {17 IRepository<PotwierdzeniaEcard> repConfirm = new Repository<PotwierdzeniaEcard>(new FakeDataContext());18 var builder = new TestControllerBuilder();19 var controller = new PlatnoscController(null, null, repConfirm, null);20 builder.InitializeController(controller);21 builder.Form.Add("MERCHANTNUMBER", "132423");22 builder.Form.Add("ORDERNUMBER", "32hvhsvhv");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"); 23 24 24 var result = controller.Status() as ContentResult;25 System.Diagnostics.Debug.WriteLine("1. Zły formt ordernumber.");26 System.Diagnostics.Debug.WriteLine("2. Count: " + repConfirm.Count());27 System.Diagnostics.Debug.WriteLine("3. Contetnt: " + result.Content);28 Assert.That(repConfirm.Count().Equals(0));29 Assert.That(result.Content.Contains("FormatException"));30 }31 [Test]32 [Category("Unit")]33 public void FormatException_Paymenttype_Test()34 {35 IRepository<PotwierdzeniaEcard> repConfirm = new Repository<PotwierdzeniaEcard>(new FakeDataContext());36 var builder = new TestControllerBuilder();37 var controller = new PlatnoscController(null, null, repConfirm, null);38 builder.InitializeController(controller);39 builder.Form.Add("MERCHANTNUMBER", "132423");40 builder.Form.Add("PAYMENTTYPE", "32hvhsvhv");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"); 41 42 42 var result = controller.Status() as ContentResult;43 System.Diagnostics.Debug.WriteLine("Zły formt paymenttype. " + " Count: " + repConfirm.Count());44 Assert.That(repConfirm.Count().Equals(0));45 Assert.That(result.Content.Contains("FormatException"));46 }47 [Test]48 [Category("Unit")]49 public void FormatException_Eventtype_Test()50 {51 IRepository<PotwierdzeniaEcard> repConfirm = new Repository<PotwierdzeniaEcard>(new FakeDataContext());52 var builder = new TestControllerBuilder();53 var controller = new PlatnoscController(null, null, repConfirm, null);54 builder.InitializeController(controller);55 builder.Form.Add("MERCHANTNUMBER", "132423");56 builder.Form.Add("EVENTTYPE", "32hvhsvhv");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"); 57 58 58 var result = controller.Status() as ContentResult;59 System.Diagnostics.Debug.WriteLine("Zły formt eventtype. " + " Count: " + repConfirm.Count());60 Assert.That(repConfirm.Count().Equals(0));61 Assert.That(result.Content.Contains("FormatException"));62 }63 [Test]64 [Category("Unit")]65 public void OverflowException_Ordernumber_Test()66 {67 var controller = new PlatnoscController();68 var builder = new TestControllerBuilder();69 builder.InitializeController(controller);70 builder.Form.Add("MERCHANTNUMBER", "132");71 builder.Form.Add("ORDERNUMBER", "12311111111111111");72 builder.Form.Add("VALIDATIONCODE", "AAA");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"); 73 74 74 var result = controller.Status() as ContentResult;75 System.Diagnostics.Debug.WriteLine("1. Wartosc ordernumber jest za duza.");76 System.Diagnostics.Debug.WriteLine("2. Contetnt: " + result.Content);77 Assert.That(result.Content.Contains("OverflowException"));78 }79 [Test]80 [Category("Unit")]81 public void IncorrectLength_Validationcode_Test()82 {83 var controller = new PlatnoscController();84 var builder = new TestControllerBuilder();85 builder.InitializeController(controller);86 builder.Form.Add("MERCHANTNUMBER", "132");87 builder.Form.Add("ORDERNUMBER", "1234");88 builder.Form.Add("VALIDATIONCODE", "AAAaaa");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"); 89 90 90 var result = controller.Status() as ContentResult;91 System.Diagnostics.Debug.WriteLine("1. Validationcode jest zbyt dlugi. Conajwyzej 3 znaki.");92 System.Diagnostics.Debug.WriteLine("2. Contetnt: " + result.Content);93 Assert.That(result.Content.Contains("SqlException"));94 }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 //} 95 96 } 96 97 } -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/TestMethods.cs
r969 r970 1 using NUnit.Framework; 2 using Platnosci.Core.Linq; 1 using adMoto.Payments.Core; 2 using adMoto.Payments.Core.Data; 3 using NUnit.Framework; 3 4 4 5 namespace Platnosci.Tests.Web … … 14 15 { 15 16 var fake = new FakeDataContext(); 16 var vPlatnosciEcardRepository = new Repository< vPlatnosciEcard>(fake);17 var vPlatnosciEcardRepository = new Repository<Invoice>(fake); 17 18 18 19 var platnosc = _function.CreateInvoice(123, "nip", "", 0, 0); 19 20 vPlatnosciEcardRepository.Insert(platnosc); 20 21 21 System.Diagnostics.Debug.WriteLine("rep.Count: " + vPlatnosciEcardRepository.Count()); 22 System.Diagnostics.Debug.WriteLine("rep.Count: " + vPlatnosciEcardRepository.Count()); 22 23 var pl = vPlatnosciEcardRepository.FindOne(123); 23 24 System.Diagnostics.Debug.WriteLine("Wartosc nip ma byc 'nip'. Jest " + pl.nip); 24 25 Assert.That(pl.nip, Is.EqualTo("nip")); 25 } 26 26 } 27 27 } 28 28 } -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/ValidationMerchantClassTests.cs
r969 r970 1 using NUnit.Framework;2 using Platnosci.Core.Linq;1 using adMoto.Payments.Core; 2 using adMoto.Payments.Core.Data; 3 3 4 using NUnit.Framework; 4 5 5 6 namespace Platnosci.Tests.Web -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/eCardDataTests.cs
r969 r970 1 1 using System; 2 using adMoto.Payments.Core; 3 using adMoto.Payments.Core.Data; 2 4 using NUnit.Framework; 3 5 using Platnosci.Models; 4 using Platnosci.Core.Linq;5 6 6 7 namespace Platnosci.Tests.Web … … 186 187 var amountEUR = 1300; 187 188 188 var repVPayment = new Repository< vPlatnosciEcard>(new FakeDataContext());189 var repVPayment = new Repository<Invoice>(new FakeDataContext()); 189 190 var invoice = _function.CreateForeignInvoice(idFaktury, "nip1", "abc/2009", amountPL, 0, amountEUR, "EUR"); 190 191 repVPayment.Insert(invoice);
