1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package order
- import (
- "testing"
- "time"
- "adt/pkg/alias"
- )
- type tester struct {
- t *testing.T
- }
- func TestOrder(t *testing.T) {
- sf := &tester{
- t: t,
- }
- sf.unmarshall()
- }
- // Десериализует заказ бронирования
- func (sf *tester) unmarshall() {
- sf.t.Log("unmarshall")
- sf.unmarshallBad1()
- }
- // даты заезда и выезда кривые
- func (sf *tester) unmarshallBad1() {
- sf.t.Log("unmarshallBad1")
- from, _ := time.Parse("2006-01-02", "2024-01-02")
- to, _ := time.Parse("2006-01-02", "2024-01-04")
- order := &Order{
- HotelId_: alias.HotelId("1"),
- RoomID_: alias.RoomId("2"),
- UserEmail_: alias.Email("guest@mail.ru"),
- From_: from,
- To_: to,
- }
- _, err := Unmarshall(order.Marshall())
- sf.t.Log(err)
- }
|