github.com/bitcubate/cryptojournal@v1.2.5-0.20171102134152-f578b3d788ab/src/lib/status/status_test.go (about)

     1  package status
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  // Resource embeds ResourceStatus
     8  type resource struct {
     9  	ResourceStatus
    10  }
    11  
    12  // TestOptions tests our options are functional when embedded in a resource.
    13  func TestOptions(t *testing.T) {
    14  
    15  	r := &resource{}
    16  
    17  	options := r.StatusOptions()
    18  	if len(options) < 0 {
    19  		t.Fatalf("status: failed to get status options")
    20  	}
    21  
    22  	r.Status = Published
    23  	if r.StatusDisplay() != "Published" {
    24  		t.Fatalf("status: failed to get status published")
    25  	}
    26  
    27  }