github.com/google/go-github/v70@v70.0.0/github/interactions_test.go (about)

     1  // Copyright 2021 The go-github AUTHORS. All rights reserved.
     2  //
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package github
     7  
     8  import "testing"
     9  
    10  func TestInteractionRestriction_Marshal(t *testing.T) {
    11  	t.Parallel()
    12  	testJSONMarshal(t, &InteractionRestriction{}, "{}")
    13  
    14  	u := &InteractionRestriction{
    15  		Limit:     Ptr("limit"),
    16  		Origin:    Ptr("origin"),
    17  		ExpiresAt: &Timestamp{referenceTime},
    18  	}
    19  
    20  	want := `{
    21  		"limit": "limit",
    22  		"origin": "origin",
    23  		"expires_at": ` + referenceTimeStr + `
    24  	}`
    25  
    26  	testJSONMarshal(t, u, want)
    27  }