'use strict';

describe('myApp.view1 module', function() {

  beforeEach(module('myApp.view1'));

  describe("Akan Name Check", function(){

    it('should set $scope.n to "Kwadwo"', inject (function($controller) {
      var scope = {}, ctrl = $controller('View1Ctrl', {$scope:scope});

      scope.date='01';
      scope.month='01';
      scope.year='1990';
      scope.gender = "m";
      scope.dateOfBirth();
      expect(scope.dateOfBirth()).toEqual("Kwadwo");
    }));

  });

  describe("Failed Name Test", function(){

    it('should set $scope.n to "Unknown"', inject (function($controller) {
      var scope = {}, ctrl = $controller('View1Ctrl', {$scope:scope});

      scope.date='21';
      scope.month='12';
      scope.year='1930';
      scope.gender = ""; //No gender should provide no Akan name or Unknown
      scope.dateOfBirth();
      expect(scope.dateOfBirth()).toEqual("Unknown");
    }));

  });

  describe("Friday Male Akan Name Test", function(){

    it('should set $scope.n to "Kofi"', inject (function($controller) {
      var scope = {}, ctrl = $controller('View1Ctrl', {$scope:scope});

      scope.date='19';
      scope.month='09';
      scope.year='2014';
      scope.gender = "m"; //No gender should provide no Akan name or Unknown
      scope.dateOfBirth();
      expect(scope.dateOfBirth()).toEqual("Kofi");
    }));

  });

  describe("Tuesday Female Akan Name Test", function(){

    it('should set $scope.n to "Abena"', inject (function($controller) {
      var scope = {}, ctrl = $controller('View1Ctrl', {$scope:scope});

      scope.date='02';
      scope.month='09';
      scope.year='2014';
      scope.gender = "f"; //No gender should provide no Akan name or Unknown
      scope.dateOfBirth();
      expect(scope.dateOfBirth()).toEqual("Abena");
    }));

  });

  describe("Thursday Female Akan Name Test", function(){

    it('should set $scope.n to "Yaa"', inject (function($controller) {
      var scope = {}, ctrl = $controller('View1Ctrl', {$scope:scope});

      scope.date='04';
      scope.month='09';
      scope.year='2014';
      scope.gender = "f"; //No gender should provide no Akan name or Unknown
      scope.dateOfBirth();
      expect(scope.dateOfBirth()).toEqual("Yaa");
    }));

  });


});