github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/cf/models/service_instance_test.go (about)

     1  package models_test
     2  
     3  import (
     4  	. "code.cloudfoundry.org/cli/cf/models"
     5  	. "github.com/onsi/ginkgo"
     6  	. "github.com/onsi/gomega"
     7  )
     8  
     9  var _ = Describe("ServiceInstance", func() {
    10  	var (
    11  		serviceInstance ServiceInstance
    12  	)
    13  
    14  	BeforeEach(func() {
    15  		serviceInstance = ServiceInstance{}
    16  	})
    17  
    18  	Describe("isUserProvided", func() {
    19  		When("service instance is of non user provided type", func() {
    20  			BeforeEach(func() {
    21  				serviceInstance.Type = "managed_service_instance"
    22  			})
    23  
    24  			It("returns false", func() {
    25  				Expect(serviceInstance.IsUserProvided()).To(BeFalse())
    26  			})
    27  		})
    28  
    29  		When("service instance is of user provided type", func() {
    30  			BeforeEach(func() {
    31  				serviceInstance.Type = "user_provided_service_instance"
    32  			})
    33  
    34  			It("returns true", func() {
    35  				Expect(serviceInstance.IsUserProvided()).To(BeTrue())
    36  			})
    37  		})
    38  
    39  	})
    40  })