<commit_before>package goapns_test

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/tantalum73/Go-APNS"
)

func TestMessageSetter(t *testing.T) {
	m := goapns.NewMessage()

	m.Badge(42)
	assert.Equal(t, 42, m.Payload.Badge, "Badge not set correctly")

	m.NoBadgeChange()
	assert.Equal(t, -1, m.Payload.Badge, "Badge not re-set correctly")

	m.ContentAvailable()
	assert.Equal(t, 1, m.Payload.ContentAvailable, "ContentAvailable not set correctly")
	assert.Equal(t, 5, m.Header.Priority, "ContentAvailable not set correctly")

	m.ContentUnavailable()
	assert.Equal(t, 0, m.Payload.ContentAvailable, "ContentUnavailable not set correctly")
	assert.Equal(t, 10, m.Header.Priority, "ContentUnavailable not set correctly")

	// message := goapns.NewMessage().Title("Title").Body("A Test notification :)").Sound("Default").Badge(42)<commit_msg>More testing<commit_after>package goapns_test

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/tantalum73/Go-APNS"
)

func TestMessageSetter(t *testing.T) {
	m := goapns.NewMessage()

	m.Badge(42)
	assert.Equal(t, 42, m.Payload.Badge, "Badge not set correctly")

	//Testing default priority
	assert.Equal(t, 10, m.Header.Priority)

	m.NoBadgeChange()
	assert.Equal(t, -1, m.Payload.Badge, "Badge not re-set correctly")

	m.ContentAvailable()
	assert.Equal(t, 1, m.Payload.ContentAvailable, "ContentAvailable not set correctly")
	assert.Equal(t, 5, m.Header.Priority, "ContentAvailable not set correctly")

	m.ContentUnavailable()
	assert.Equal(t, 0, m.Payload.ContentAvailable, "ContentUnavailable not set correctly")
	assert.Equal(t, 10, m.Header.Priority, "ContentUnavailable not set correctly")

	// message := goapns.NewMessage().Title("Title").Body("A Test notification :)").Sound("Default").Badge(42)
{'fraction_non_alphanumeric': 0.15011160714285715, 'fraction_numerical': 0.016741071428571428, 'mean_word_length': 5.4496402877697845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1148449', 'n_tokens_mistral': 649, 'n_tokens_neox': 614, 'n_words': 130}