// Test invalidation behavior using testResource as a mock
Test invalidation behavior using testResource as a mock
// Test invalidation behavior using testResource as a mock
func TestSimpleDepEverythingValid(t *testing.T) {
	r := &testutils.MockRunner{Output: "", Err: nil}
	b := NewBuilder()
	b.AddResource("dependee", &testResource{ID: "dependee"})
	b.AddResource("dependent", &testResource{ID: "dependent"}, DependOn("dependee"))
	assert.Equal(t, 0, len(b.Errors()))
	p, err := b.Plan()
	assert.NoError(t, err)
	resourceValidity := p.EnsureResourceValid("dependent", r)
	assert.Equal(
		t,
		ValidityTree{
			ResourceID:     "dependent",
			ValidityStatus: Valid,
			Reason:         None,
			Dependencies: []ValidityTree{
				{
					ResourceID:     "dependee",
					ValidityStatus: Valid,
					Reason:         None,
					Dependencies:   []ValidityTree{},
				}}},
		resourceValidity)
}
func TestSimpleDepEverythingValid ( t * testing . T ) { r := & testutils . MockRunner { Output : " " , Err : nil } b := NewBuilder ( ) b . AddResource ( " " , & testResource { ID : " " } ) b . AddResource ( " " , & testResource { ID : " " } , DependOn ( " " ) ) assert . Equal ( t , 0 , len ( b . Errors ( ) ) ) p , err := b . Plan ( ) assert . NoError ( t , err ) resourceValidity := p . EnsureResourceValid ( " " , r ) assert . Equal ( t , ValidityTree { ResourceID : " " , ValidityStatus : Valid , Reason : None , Dependencies : [ ] ValidityTree { { ResourceID : " " , ValidityStatus : Valid , Reason : None , Dependencies : [ ] ValidityTree { } , } } } , resourceValidity ) }
Test invalidation behavior using testResource as a mock
Test invalidation behavior using testResource as a mock