You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: fake_database_test.go
    path of file: ./repos/pipeline/pkg/gorm/test
    
    the code of the file until where you have to start completion: // Copyright Â© 2020 Banzai Cloud
//
// Licensed under the Apache Licen
    
func TestFakeDatabaseSetError(t *testing.T) {
	type inputType struct {
		database *FakeDatabase
		t        TestObject
		err      error
	}

	testCases := []struct {
		caseDescription string
		input           inputType
	}{
		{
			caseDescription: "nil database -> nil database success",
			input: inputType{
				database: nil,
			},
		},
		{
			caseDescription: "nil t -> original database success",
			input: inputType{
				database: NewFakeDatabase(t),
				t:        nil,
			},
		},
		{
			caseDescription: "nil error -> database no error success",
			input: inputType{
				database: NewFakeDatabase(t),
				t:        &fakeNoopTestObject{},
				err:      nil,
			},
		},
		{
			caseDescription: "not nil error -> database error success",
			input: inputType{
				database: NewFakeDatabase(t),
				t:        &fakeNoopTestObject{},
				err:      errors.New("test error"),
			},
		},
	}

	for _, testCase := range testCases {
		testCase := testCase

		t.Run(testCase.caseDescription, func(t *testing.T) {
			if testCase.input.database != nil &&
				testCase.input.t != nil {
				require.NoError(t, testCase.input.database.DB.Error)
			}

			actualDatabase := testCase.input.database.SetError(
				testCase.input.t,
				testCase.input.err,
			)

			if testCase.input.database == nil {
				require.Nil(t, actualDatabase)
			} else if testCase.input.t == nil {
				require.Equal(t, testCase.input.database, actualDatabase)
			} else {
				require.NotNil(t, actualDatabase)
				require.NotNil(t, actualDatabase.DB)

				if testCase.input.err == nil {
					require.NoError(t, actualDatabase.DB.Error)
				} else {
					require.EqualError(t, actualDatabase.DB.Error, testCase.input.err.Error())
				}
			}
		})
	}
}