2021年3月30日星期二

how to populate a test function with given input-golang

I have the following code

func TestBookingListing_provisionHistory(t *testing.T) {      Setup(false)        b := Booking{                    Status: StatusActive,                ListingIDs: []int64{1, 2},      }        for _, l := range b.ListingIDs {            bl := BookingListing{              BookingID:   b.ID,              ListingID:   l,              Created:     b.Created,              Status:      StatusPending,              RequestedBy: "Jane",              Type:        b.Type,              Updated:     b.Created,          }                      if Status(bl.RequestedBy) != StatusExpired {                t.Error("expecting status of bookinglisting to be requested")            }        }  }  

I need to display the name of Requestedby in when the status is not expired. How can this be done thanking in advance

https://stackoverflow.com/questions/66880283/how-to-populate-a-test-function-with-given-input-golang March 31, 2021 at 09:01AM

没有评论:

发表评论