Order.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using Shouldly;
  3. namespace PetaPoco.Tests.Unit.Models
  4. {
  5. [ExplicitColumns]
  6. [TableName("Orders")]
  7. [PrimaryKey("Id")]
  8. public class Order
  9. {
  10. [Column]
  11. public int Id { get; set; }
  12. [Column]
  13. public Guid PersonId { get; set; }
  14. [Column]
  15. public string PoNumber { get; set; }
  16. [Column]
  17. public DateTime CreatedOn { get; set; }
  18. [Column]
  19. public string CreatedBy { get; set; }
  20. [Column("OrderStatus")]
  21. public OrderStatus Status { get; set; }
  22. public void ShouldBe(Order other)
  23. {
  24. Id.ShouldBe(other.Id);
  25. PersonId.ShouldBe(other.PersonId);
  26. PoNumber.ShouldBe(other.PoNumber);
  27. Status.ShouldBe(other.Status);
  28. CreatedOn.ShouldBe(other.CreatedOn);
  29. CreatedBy.ShouldBe(other.CreatedBy);
  30. }
  31. public void ShouldNotBe(Order other, bool sameIds)
  32. {
  33. if (sameIds)
  34. {
  35. Id.ShouldBe(other.Id);
  36. PersonId.ShouldBe(other.PersonId);
  37. }
  38. else
  39. {
  40. Id.ShouldNotBe(other.Id);
  41. PersonId.ShouldNotBe(other.PersonId);
  42. }
  43. PoNumber.ShouldNotBe(other.PoNumber);
  44. Status.ShouldNotBe(other.Status);
  45. CreatedOn.ShouldNotBe(other.CreatedOn);
  46. CreatedBy.ShouldNotBe(other.CreatedBy);
  47. }
  48. }
  49. }