// 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"
	otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development"
	"go.opentelemetry.io/collector/pdata/pcommon"
)

func TestProfilesDictionary_MoveTo(t *testing.T) {
	ms := generateTestProfilesDictionary()
	dest := NewProfilesDictionary()
	ms.MoveTo(dest)
	assert.Equal(t, NewProfilesDictionary(), ms)
	assert.Equal(t, generateTestProfilesDictionary(), dest)
	dest.MoveTo(dest)
	assert.Equal(t, generateTestProfilesDictionary(), dest)
	sharedState := internal.StateReadOnly
	assert.Panics(t, func() { ms.MoveTo(newProfilesDictionary(&otlpprofiles.ProfilesDictionary{}, &sharedState)) })
	assert.Panics(t, func() { newProfilesDictionary(&otlpprofiles.ProfilesDictionary{}, &sharedState).MoveTo(dest) })
}

func TestProfilesDictionary_CopyTo(t *testing.T) {
	ms := NewProfilesDictionary()
	orig := NewProfilesDictionary()
	orig.CopyTo(ms)
	assert.Equal(t, orig, ms)
	orig = generateTestProfilesDictionary()
	orig.CopyTo(ms)
	assert.Equal(t, orig, ms)
	sharedState := internal.StateReadOnly
	assert.Panics(t, func() { ms.CopyTo(newProfilesDictionary(&otlpprofiles.ProfilesDictionary{}, &sharedState)) })
}

func TestProfilesDictionary_MappingTable(t *testing.T) {
	ms := NewProfilesDictionary()
	assert.Equal(t, NewMappingSlice(), ms.MappingTable())
	ms.orig.MappingTable = internal.GenerateOrigTestMappingSlice()
	assert.Equal(t, generateTestMappingSlice(), ms.MappingTable())
}

func TestProfilesDictionary_LocationTable(t *testing.T) {
	ms := NewProfilesDictionary()
	assert.Equal(t, NewLocationSlice(), ms.LocationTable())
	ms.orig.LocationTable = internal.GenerateOrigTestLocationSlice()
	assert.Equal(t, generateTestLocationSlice(), ms.LocationTable())
}

func TestProfilesDictionary_FunctionTable(t *testing.T) {
	ms := NewProfilesDictionary()
	assert.Equal(t, NewFunctionSlice(), ms.FunctionTable())
	ms.orig.FunctionTable = internal.GenerateOrigTestFunctionSlice()
	assert.Equal(t, generateTestFunctionSlice(), ms.FunctionTable())
}

func TestProfilesDictionary_LinkTable(t *testing.T) {
	ms := NewProfilesDictionary()
	assert.Equal(t, NewLinkSlice(), ms.LinkTable())
	ms.orig.LinkTable = internal.GenerateOrigTestLinkSlice()
	assert.Equal(t, generateTestLinkSlice(), ms.LinkTable())
}

func TestProfilesDictionary_StringTable(t *testing.T) {
	ms := NewProfilesDictionary()
	assert.Equal(t, pcommon.NewStringSlice(), ms.StringTable())
	ms.orig.StringTable = internal.GenerateOrigTestStringSlice()
	assert.Equal(t, pcommon.StringSlice(internal.GenerateTestStringSlice()), ms.StringTable())
}

func TestProfilesDictionary_AttributeTable(t *testing.T) {
	ms := NewProfilesDictionary()
	assert.Equal(t, NewAttributeTableSlice(), ms.AttributeTable())
	ms.orig.AttributeTable = internal.GenerateOrigTestKeyValueSlice()
	assert.Equal(t, generateTestAttributeTableSlice(), ms.AttributeTable())
}

func TestProfilesDictionary_AttributeUnits(t *testing.T) {
	ms := NewProfilesDictionary()
	assert.Equal(t, NewAttributeUnitSlice(), ms.AttributeUnits())
	ms.orig.AttributeUnits = internal.GenerateOrigTestAttributeUnitSlice()
	assert.Equal(t, generateTestAttributeUnitSlice(), ms.AttributeUnits())
}

func generateTestProfilesDictionary() ProfilesDictionary {
	ms := NewProfilesDictionary()
	internal.FillOrigTestProfilesDictionary(ms.orig)
	return ms
}
