Guest User

Untitled

a guest
Nov 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. using CarrinhoDeCompras.Domain.Entidades;
  2. using CarrinhoDeCompras.Domain.Interfaces.Repositorios;
  3. using CarrinhoDeCompras.Infra.Data.EF.Repositorios;
  4. using Microsoft.VisualStudio.TestTools.UnitTesting;
  5. using System;
  6.  
  7. namespace CarrinhoDeCompras.Application.Test
  8. {
  9. [TestClass]
  10. public class OrdersTest
  11. {
  12. private IRepositorioOrders _repositorio;
  13. [TestMethod]
  14. public void InclirPedidos()
  15. {
  16. var order = new Orders()
  17. {
  18. CustomerID = 85,
  19. Customer = "VINET",
  20. EmployeeID = 5,
  21. OrderDate = DateTime.Now,
  22. RequiredDate = DateTime.Now,
  23. ShippedDate = DateTime.Now,
  24. ShipVia = 3,
  25. Freight = 13,
  26. ShipName = "Vins et alcools Chevalier",
  27. ShipAddress = "59 rue de l'Abbaye",
  28. ShipCity = "Reims",
  29. ShipPostalCode = "51100",
  30. ShipCountry = "France",
  31. };
  32.  
  33.  
  34. try
  35. {
  36. _repositorio = new RepositorioOrders();
  37. _repositorio.Add(order);
  38. }
  39. catch (Exception ex)
  40. {
  41. throw;
  42. }
  43. }
  44. }
  45. }
  46.  
  47. public partial class Orders
  48. {
  49. public Orders()
  50. {
  51. this.OrderDetails = new HashSet<OrderDetails>();
  52. this.Employees = new Employees();
  53. this.Customers = new Customers();
  54. this.Shippers = new Shippers();
  55. }
  56.  
  57. public int OrderID { get; set; }
  58. public int? CustomerID { get; set; }
  59. public string Customer { get; set; }
  60. public int? EmployeeID { get; set; }
  61. public DateTime? OrderDate { get; set; }
  62. public DateTime? RequiredDate { get; set; }
  63. public DateTime? ShippedDate { get; set; }
  64. public int ShipVia { get; set; }
  65. public decimal? Freight { get; set; }
  66. public string ShipName { get; set; }
  67. public string ShipAddress { get; set; }
  68. public string ShipCity { get; set; }
  69. public string ShipRegion { get; set; }
  70. public string ShipPostalCode { get; set; }
  71. public string ShipCountry { get; set; }
  72. public virtual Customers Customers { get; set; }
  73. public virtual Employees Employees { get; set; }
  74. public virtual ICollection<OrderDetails> OrderDetails { get; set; }
  75. public virtual Shippers Shippers { get; set; }
  76. }
Add Comment
Please, Sign In to add comment