<commit_before>﻿using SEEK.AdPostingApi.Client.Models;

namespace SEEK.AdPostingApi.Client.Tests.Framework
{
    public class MinimumFieldsInitializer : IBuilderInitializer
    {
        public void Initialize(AdvertisementContentBuilder builder)
        {
            builder
                .WithAdvertiserId(this.GetDefaultAdvertiserId())
                .WithJobTitle(GetDefaultJobTitle())
                .WithEmploymentType(GetDefaultEmploymentType())
                .WithSalaryMinimum(GetDefaultSalaryMinimum())
                .WithSalaryMaximum(GetDefaultSalaryMaximum())
                .WithSalaryCurrencyCode(GetDefaultSalaryCurrencyCode())
                .WithSalaryDisplay(GetDefaultSalaryDisplay())
                .WithLocationId(GetDefaultLocationId())
                .WithLocationArea(GetDefaultLocationArea())
                .WithJobDescription(GetDefaultJobDescription())
                .WithJobSpecialization(GetDefaultJobSpecialization())
                .WithJobRole(GetDefaultJobRole())
                .WithEducationLevel(GetDefaultEducationLevel())
                .WithFieldOfStudy(GetDefaultFieldOfStudy())
                .WithPositionLevel(GetDefaultPositionLevel())
                .WithYearOfExperience(GetDefaultYearOfExperience())
                .WithSite(GetDefaultSite());
                
            /*builder
                //.WithAdvertisementDetails(this.GetDefaultAdvertisementDetails())
                .WithAdvertiserId(this.GetDefaultAdvertiserId())
                //.WithAdvertisementType(AdvertisementType.Classic.ToString())
                //.WithJobSummary(this.GetDefaultJobSummary())
                .WithJobTitle(this.GetDefaultJobTitle())
                //.WithLocationId(this.GetDefaultLocationId())
                //.WithLocationAreaId(this.GetDefaultLocationAreaId())
                .WithSalaryMinimum(this.GetDefaultSalaryMinimum())
                .WithSalaryMaximum(this.GetDefaultSalaryMaximum())
                //.WithSalaryType(this.GetDefaultSalaryType().ToString())
                //.WithSubclassificationId(this.GetDefaultSubclassificationId())
                //.WithWorkType(this.GetDefaultWorkType().ToString())
                //.WithRecruiterFullName(this.GetDefaultRecruiterFullName())
                //.WithRecruiterEmail(this.GetDefaultRecruiterEmail());*/
        }

        public void Initialize<TAdvertisement>(AdvertisementModelBuilder<TAdvertisement> builder)
            where TAdvertisement : Advertisement, new()
        {
            builder
                .WithAdvertiserId(this.GetDefaultAdvertiserId())
                .WithJobTitle(GetDefaultJobTitle())
                .WithEmploymentType(GetDefaultEmploymentType())
                .WithSalaryMinimum(GetDefaultSalaryMinimum())
                .WithSalaryMaximum(GetDefaultSalaryMaximum())
                .WithSalaryCurrencyCode(GetDefaultSalaryCurrencyCode())
                .WithSalaryDisplay(GetDefaultSalaryDisplay())
                .WithLocationId(GetDefaultLocationId())
                .WithLocationArea(GetDefaultLocationArea())
                .WithJobDescription(GetDefaultJobDescription())
                .WithJobSpecialization(GetDefaultJobSpecialization())
                .WithJobRole(GetDefaultJobRole())
                .WithEducationLevel(GetDefaultEducationLevel())
                .WithFieldOfStudy(GetDefaultFieldOfStudy())
                .WithPositionLevel(GetDefaultPositionLevel())
                .WithYearOfExperience(GetDefaultYearOfExperience())
                .WithSite(GetDefaultSite());

            /*builder
                .WithAdvertiserId(this.GetDefaultAdvertiserId())
                //.WithAdvertisementType(AdvertisementType.Classic)
                .WithJobTitle(this.GetDefaultJobTitle())
                //.WithLocationArea(this.GetDefaultLocationId(), this.GetDefaultLocationAreaId())
                //.WithSubclassificationId(this.GetDefaultSubclassificationId())
                //.WithWorkType(this.GetDefaultWorkType())
                //.WithSalaryType(this.GetDefaultSalaryType())
                .WithSalaryMinimum(this.GetDefaultSalaryMinimum())
                .WithSalaryMaximum(this.GetDefaultSalaryMaximum())
                //.WithJobSummary(this.GetDefaultJobSummary())
                //.WithAdvertisementDetails(this.GetDefaultAdvertisementDetails())
                //.WithRecruiterFullName(this.GetDefaultRecruiterFullName())
                //.WithRecruiterEmail(this.GetDefaultRecruiterEmail());*/
        }

        private string GetDefaultAdvertiserId()
        {
            return "1001000001";
        }

        private string GetDefaultJobTitle()
        {
            return "Front-end Developer";
        }

        private int?[] GetDefaultEmploymentType()
        {
            return new int?[] { 3 };
        }

        private decimal GetDefaultSalaryMinimum()
        {
            return (decimal)1000.0;
        }

        private decimal GetDefaultSalaryMaximum()
        {
            return (decimal)1599.0;
        }

        private int GetDefaultSalaryCurrencyCode()
        {
            return 1;
        }

        private bool GetDefaultSalaryDisplay()
        {
            return true;
        }

        private int?[] GetDefaultLocationId()
        {
            return new int?[] { 50001 };
        }

        private string GetDefaultLocationArea()
        {
            return "Test Area";
        }

        private string GetDefaultJobDescription()
        {
            return "This is job description";
        }

        private int GetDefaultJobSpecialization()
        {
            return 191;
        }

        private int GetDefaultJobRole()
        {
            return 1333;
        }

        private int?[] GetDefaultEducationLevel()
        {
            return new int?[] { 4, 5};
        }

        private int?[] GetDefaultFieldOfStudy()
        {
            return new int?[] { 8 };
        }

        private int? GetDefaultPositionLevel()
        {
            return 16;
        }

        private int GetDefaultYearOfExperience()
        {
            return 2;
        }

        private int?[] GetDefaultSite()
        {
            return new int?[] { 1, 2 };
        }

        private Brand GetDefaultBrand()
        {
            return Brand.jobstreet;
        }

        /* ------------------------------------------------------------------------------------------------------------ */

        /*private string GetDefaultAdvertisementDetails()
        {
            return "Exciting, do I need to say more?";
        }*/

        /*private string GetDefaultAdvertiserId()
        {
            return "1";
        }*/

        /*private string GetDefaultJobSummary()
        {
            return "Developer job";
        }*/
<commit_msg>HIRER-4145 Fixed unit test case.<commit_after>﻿using SEEK.AdPostingApi.Client.Models;
using System;

namespace SEEK.AdPostingApi.Client.Tests.Framework
{
    public class MinimumFieldsInitializer : IBuilderInitializer
    {
        public void Initialize(AdvertisementContentBuilder builder)
        {
            builder
                .WithAdvertiserId(GetDefaultAdvertiserId())
                .WithJobTitle(GetDefaultJobTitle())
                .WithEmploymentType(GetDefaultEmploymentType())
                .WithSalaryMinimum(GetDefaultSalaryMinimum())
                .WithSalaryMaximum(GetDefaultSalaryMaximum())
                .WithSalaryCurrencyCode(GetDefaultSalaryCurrencyCode())
                .WithSalaryDisplay(GetDefaultSalaryDisplay())
                .WithLocationId(GetDefaultLocationId())
                .WithLocationArea(GetDefaultLocationArea())
                .WithJobDescription(GetDefaultJobDescription())
                .WithJobSpecialization(GetDefaultJobSpecialization())
                .WithJobRole(GetDefaultJobRole())
                .WithEducationLevel(GetDefaultEducationLevel())
                .WithFieldOfStudy(GetDefaultFieldOfStudy())
                .WithPositionLevel(GetDefaultPositionLevel())
                .WithYearOfExperience(GetDefaultYearOfExperience())
                .WithSite(GetDefaultSite())
                .WithBlindAd(GetDefaultBlindAd())
                .WithPostingDate(GetDefaultPostingDate())
                .WithAction(GetDefaultAction());
            /*builder
                //.WithAdvertisementDetails(this.GetDefaultAdvertisementDetails())
                .WithAdvertiserId(this.GetDefaultAdvertiserId())
                //.WithAdvertisementType(AdvertisementType.Classic.ToString())
                //.WithJobSummary(this.GetDefaultJobSummary())
                .WithJobTitle(this.GetDefaultJobTitle())
                //.WithLocationId(this.GetDefaultLocationId())
                //.WithLocationAreaId(this.GetDefaultLocationAreaId())
                .WithSalaryMinimum(this.GetDefaultSalaryMinimum())
                .WithSalaryMaximum(this.GetDefaultSalaryMaximum())
                //.WithSalaryType(this.GetDefaultSalaryType().ToString())
                //.WithSubclassificationId(this.GetDefaultSubclassificationId())
                //.WithWorkType(this.GetDefaultWorkType().ToString())
                //.WithRecruiterFullName(this.GetDefaultRecruiterFullName())
                //.WithRecruiterEmail(this.GetDefaultRecruiterEmail());*/
        }

        public void Initialize<TAdvertisement>(AdvertisementModelBuilder<TAdvertisement> builder)
            where TAdvertisement : Advertisement, new()
        {
            builder
                .WithAdvertiserId(this.GetDefaultAdvertiserId())
                .WithJobTitle(GetDefaultJobTitle())
                .WithEmploymentType(GetDefaultEmploymentType())
                .WithSalaryMinimum(GetDefaultSalaryMinimum())
                .WithSalaryMaximum(GetDefaultSalaryMaximum())
                .WithSalaryCurrencyCode(GetDefaultSalaryCurrencyCode())
                .WithSalaryDisplay(GetDefaultSalaryDisplay())
                .WithLocationId(GetDefaultLocationId())
                .WithLocationArea(GetDefaultLocationArea())
                .WithJobDescription(GetDefaultJobDescription())
                .WithJobSpecialization(GetDefaultJobSpecialization())
                .WithJobRole(GetDefaultJobRole())
                .WithEducationLevel(GetDefaultEducationLevel())
                .WithFieldOfStudy(GetDefaultFieldOfStudy())
                .WithPositionLevel(GetDefaultPositionLevel())
                .WithYearOfExperience(GetDefaultYearOfExperience())
                .WithSite(GetDefaultSite())
                .WithBlindAd(GetDefaultBlindAd())
                .WithPostingDate(GetDefaultPostingDate())
                .WithAction(GetDefaultAction());
            /*builder
                .WithAdvertiserId(this.GetDefaultAdvertiserId())
                //.WithAdvertisementType(AdvertisementType.Classic)
                .WithJobTitle(this.GetDefaultJobTitle())
                //.WithLocationArea(this.GetDefaultLocationId(), this.GetDefaultLocationAreaId())
                //.WithSubclassificationId(this.GetDefaultSubclassificationId())
                //.WithWorkType(this.GetDefaultWorkType())
                //.WithSalaryType(this.GetDefaultSalaryType())
                .WithSalaryMinimum(this.GetDefaultSalaryMinimum())
                .WithSalaryMaximum(this.GetDefaultSalaryMaximum())
                //.WithJobSummary(this.GetDefaultJobSummary())
                //.WithAdvertisementDetails(this.GetDefaultAdvertisementDetails())
                //.WithRecruiterFullName(this.GetDefaultRecruiterFullName())
                //.WithRecruiterEmail(this.GetDefaultRecruiterEmail());*/
        }

        private string GetDefaultAdvertiserId()
        {
            return "1001000001";
        }

        private string GetDefaultJobTitle()
        {
            return "Front-end Developer";
        }

        private int?[] GetDefaultEmploymentType()
        {
            return new int?[] { 3 };
        }

        private decimal GetDefaultSalaryMinimum()
        {
            return (decimal)1000.0;
        }

        private decimal GetDefaultSalaryMaximum()
        {
            return (decimal)1599.0;
        }

        private int GetDefaultSalaryCurrencyCode()
        {
            return 1;
        }

        private bool GetDefaultSalaryDisplay()
        {
            return true;
        }

        private int?[] GetDefaultLocationId()
        {
            return new int?[] { 50001 };
        }

        private string GetDefaultLocationArea()
        {
            return "Test Area";
        }

        private string GetDefaultJobDescription()
        {
            return "This is job description";
        }

        private int GetDefaultJobSpecialization()
        {
            return 191;
        }

        private int GetDefaultJobRole()
        {
            return 1333;
        }

        private int?[] GetDefaultEducationLevel()
        {
            return new int?[] { 4, 5};
        }

        private int?[] GetDefaultFieldOfStudy()
        {
            return new int?[] { 8 };
        }

        private int? GetDefaultPositionLevel()
        {
            return 16;
        }

        private int GetDefaultYearOfExperience()
        {
            return 2;
        }

        private int?[] GetDefaultSite()
        {
            return new int?[] { 1, 2 };
        }

        private Brand GetDefaultBrand()
        {
            return Brand.jobstreet;
        }

        private bool GetDefaultBlindAd()
        {
            return false;
        }

        private DateTime GetDefaultPostingDate()
        {
            return new DateTime(2017, 09, 30);
        }

        private Models.Action GetDefaultAction()
        {
            return Models.Action.none; // Models.Action.none;
        }

        /* ------------------------------------------------------------------------------------------------------------ */

        /*private string GetDefaultAdvertisementDetails()
        {
            return "Exciting, do I need to say more?";
        }*/

        /*private string GetDefaultAdvertiserId()
        {
            return "1";
        }*/

        /*private string GetDefaultJobSummary()
        {
            return "Developer job";
        }*/

{'fraction_non_alphanumeric': 0.10467146149011941, 'fraction_numerical': 0.006843097549053837, 'mean_word_length': 1.7983587338804221, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2017062', 'n_tokens_mistral': 3732, 'n_tokens_neox': 3306, 'n_words': 461}