// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT.
// To regenerate this file run "make genpdata".

package pprofile

import (
	"testing"

	"github.com/stretchr/testify/assert"

	"go.opentelemetry.io/collector/pdata/internal"
)

func TestProfiles_MoveTo(t *testing.T) {
	ms := generateTestProfiles()
	dest := NewProfiles()
	ms.MoveTo(dest)
	assert.Equal(t, NewProfiles(), ms)
	assert.Equal(t, generateTestProfiles(), dest)
	dest.MoveTo(dest)
	assert.Equal(t, generateTestProfiles(), dest)
	sharedState := internal.NewState()
	sharedState.MarkReadOnly()
	assert.Panics(t, func() { ms.MoveTo(newProfiles(internal.NewExportProfilesServiceRequest(), sharedState)) })
	assert.Panics(t, func() { newProfiles(internal.NewExportProfilesServiceRequest(), sharedState).MoveTo(dest) })
}

func TestProfiles_CopyTo(t *testing.T) {
	ms := NewProfiles()
	orig := NewProfiles()
	orig.CopyTo(ms)
	assert.Equal(t, orig, ms)
	orig = generateTestProfiles()
	orig.CopyTo(ms)
	assert.Equal(t, orig, ms)
	sharedState := internal.NewState()
	sharedState.MarkReadOnly()
	assert.Panics(t, func() { ms.CopyTo(newProfiles(internal.NewExportProfilesServiceRequest(), sharedState)) })
}

func TestProfiles_ResourceProfiles(t *testing.T) {
	ms := NewProfiles()
	assert.Equal(t, NewResourceProfilesSlice(), ms.ResourceProfiles())
	ms.getOrig().ResourceProfiles = internal.GenTestResourceProfilesPtrSlice()
	assert.Equal(t, generateTestResourceProfilesSlice(), ms.ResourceProfiles())
}

func TestProfiles_Dictionary(t *testing.T) {
	ms := NewProfiles()
	assert.Equal(t, NewProfilesDictionary(), ms.Dictionary())
	ms.getOrig().Dictionary = *internal.GenTestProfilesDictionary()
	assert.Equal(t, generateTestProfilesDictionary(), ms.Dictionary())
}

func generateTestProfiles() Profiles {
	return newProfiles(internal.GenTestExportProfilesServiceRequest(), internal.NewState())
}
