<commit_before>import { test, moduleFor } from 'ember-qunit';

import Producer from 'appkit/models/producer';

moduleFor('model:producer', "Unit - ProducerModel");

test('existence of class', function () {
  ok(Producer);
});

test('init divides workers between the two products', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  equal(producer.get('productAResources'), 50);
  equal(producer.get('productBResources'), 50);
});

test('adjusting resources in Product A updates Product B', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  producer.set('productAResources', 40);
  
  equal(producer.get('productAResources'), 40);
  equal(producer.get('productBResources'), 60);
});

test('adjusting resources in Product B updates Product A', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  producer.set('productBResources', 60);
  
  equal(producer.get('productAResources'), 40);
  equal(producer.get('productBResources'), 60);
});

test('determines total produced', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  equal(producer.get('productAProduction'), 150);
  equal(producer.get('productBProduction'), 600);
});

test('total production reflects changes', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  producer.set('productAResources', 40);
  
  equal(producer.get('productAProduction'), 120);
  equal(producer.get('productBProduction'), 720);
});<commit_msg>Add test for necessary properties<commit_after>import { test, moduleFor } from 'ember-qunit';

import Producer from 'appkit/models/producer';

moduleFor('model:producer', "Unit - ProducerModel");

test('existence of class', function () {
  ok(Producer);
});

test('init divides workers between the two products', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  equal(producer.get('productAResources'), 50);
  equal(producer.get('productBResources'), 50);
});

test('has necessary properties', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  ok(producer.get('productAResources'));
  ok(producer.get('productBResources'));
  ok(producer.get('productAProduction'));
  ok(producer.get('productBProduction'));
});

test('adjusting resources in Product A updates Product B', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  producer.set('productAResources', 40);
  
  equal(producer.get('productAResources'), 40);
  equal(producer.get('productBResources'), 60);
});

test('adjusting resources in Product B updates Product A', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  producer.set('productBResources', 60);
  
  equal(producer.get('productAResources'), 40);
  equal(producer.get('productBResources'), 60);
});

test('determines total produced', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  equal(producer.get('productAProduction'), 150);
  equal(producer.get('productBProduction'), 600);
});

test('total production reflects changes', function () {
  var producer = Producer.create({
    name: 'United States',
    products: ['wheat', 'cheese'],
    ratio: [3, 12],
    resources: 100,
    unit: 'workers'
  });
  
  producer.set('productAResources', 40);
  
  equal(producer.get('productAProduction'), 120);
  equal(producer.get('productBProduction'), 720);
});
{'fraction_non_alphanumeric': 0.1724910394265233, 'fraction_numerical': 0.028225806451612902, 'mean_word_length': 4.222222222222222, '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': '229030', 'n_tokens_mistral': 1548, 'n_tokens_neox': 1411, 'n_words': 344}