ensure we provide a future date in MSRC test (#8897)

This test was failing in Dec 2022, because in this line:

```go
_, err := sut.GetFeed((now.AddDate(0, 1, 0)).Month(), now.Year())
```

`(now.AddDate(0, 1, 0)).Month()` returns `"January"` , and `now.Year()` returns `2022` , so we were sending a date in the past.
This commit is contained in:
Roberto Dip 2022-12-01 11:29:07 -03:00 committed by GitHub
parent 44609419b2
commit 837fef4bc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,9 +31,17 @@ func TestMSRCClient(t *testing.T) {
require.Error(t, err)
})
t.Run("provided month and year is in the future", func(t *testing.T) {
_, err := sut.GetFeed((now.AddDate(0, 1, 0)).Month(), now.Year())
require.Error(t, err)
t.Run("provided arguments are in the future", func(t *testing.T) {
cases := []time.Time{
now.AddDate(0, 1, 0),
now.AddDate(1, 0, 0),
now.AddDate(1, 1, 0),
}
for _, c := range cases {
_, err := sut.GetFeed(c.Month(), c.Year())
require.Error(t, err)
}
})
})