<commit_before>package gildedrose;

import static org.junit.Assert.*;

import org.junit.Test;

public class GildedRoseTest {

    @Test
    public void foo() {
        Item[] items = new Item[] { new Item("foo", 0, 0) };
        GildedRose app = new GildedRose(items);
        app.updateQuality();
        assertEquals("fixme", app.items[0].name);
    }

}<commit_msg>day 1 gildedrose<commit_after>package gildedrose;

import static org.junit.Assert.*;

import org.junit.Test;

public class GildedRoseTest {
	 class ItemBuilder{
		private String name;
		private int quality;
		private int sellIn;

		public ItemBuilder() {
			name = "+5 Dexterity Vest";
			sellIn = 10;
			quality = 20;
		}
		public ItemBuilder withName(String name) {
			this.name = name;
			return this;
		}
		public ItemBuilder withQuality(int quality) {
			this.quality = quality;
			return this;
		}
		public ItemBuilder withSellIn(int sellIn) {
			this.sellIn = sellIn;
			return this;
		}
		public Item build(){
			return new Item(name, sellIn, quality);
		}
	}

	@Test
	public void testNormalItemName() {
		Item[] items = new Item[] { new ItemBuilder().withName("foo").build()};
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertEquals("foo", app.items[0].name);
	}

	@Test
	public void testNormalItemUpdateSellIn() {
		Item[] items = new Item[] { new ItemBuilder().withSellIn(10).build() };
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertEquals(9, app.items[0].sellIn);
	}

	@Test
	public void testNormalItemUpdateQuality() {
		Item[] items = new Item[] { new ItemBuilder().withQuality(20).build() };
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertEquals(19, app.items[0].quality);
	}
	
	@Test
	public void testNormalItemPassedSellIn() {
		Item[] items = new Item[] { new ItemBuilder().withSellIn(0).withQuality(20).build() };
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertEquals(18, app.items[0].quality);
	}
	@Test
	public void testNormalItemQualityAlwaysPositive() {
		Item[] items = new Item[] { new ItemBuilder().withSellIn(0).withQuality(0).build() };
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertEquals(0, app.items[0].quality);
	}
	@Test
	public void testAgedBrieUpdateQuality() {
		Item[] items = new Item[] { new ItemBuilder().withName("Aged Brie").withQuality(20).build() };
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertEquals(21, app.items[0].quality);
	}
	@Test
	public void testAgedBrieUpdateQualityLess51() {
		Item[] items = new Item[] { new ItemBuilder().withName("Aged Brie").withQuality(50).build() };
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertTrue(app.items[0].quality < 51);
	}
	@Test
	public void testSulfurasUpdateQuality() {
		Item[] items = new Item[] { new ItemBuilder().withName("Sulfuras, Hand of Ragnaros").withQuality(80).build() };
		GildedRose app = new GildedRose(items);
		app.updateQuality();
		assertEquals(80, app.items[0].quality);
	}

}
{'fraction_non_alphanumeric': 0.14407894736842106, 'fraction_numerical': 0.015131578947368421, 'mean_word_length': 4.288695652173913, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4028363', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1017, 'n_words': 235}