order_test.go 773 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package order
  2. import (
  3. "testing"
  4. "time"
  5. "adt/pkg/alias"
  6. )
  7. type tester struct {
  8. t *testing.T
  9. }
  10. func TestOrder(t *testing.T) {
  11. sf := &tester{
  12. t: t,
  13. }
  14. sf.unmarshall()
  15. }
  16. // Десериализует заказ бронирования
  17. func (sf *tester) unmarshall() {
  18. sf.t.Log("unmarshall")
  19. sf.unmarshallBad1()
  20. }
  21. // даты заезда и выезда кривые
  22. func (sf *tester) unmarshallBad1() {
  23. sf.t.Log("unmarshallBad1")
  24. from, _ := time.Parse("2006-01-02", "2024-01-02")
  25. to, _ := time.Parse("2006-01-02", "2024-01-04")
  26. order := &Order{
  27. HotelId_: alias.HotelId("1"),
  28. RoomID_: alias.RoomId("2"),
  29. UserEmail_: alias.Email("guest@mail.ru"),
  30. From_: from,
  31. To_: to,
  32. }
  33. _, err := Unmarshall(order.Marshall())
  34. sf.t.Log(err)
  35. }