<commit_before>﻿using System;
using Bytes2you.Validation;
using MovieTheater.Data;
using MovieTheater.Framework.Core.Commands.Contracts;
using MovieTheater.Models.Factory.Contracts;

namespace MovieTheater.Framework.Core.Commands
{
    public class CommandsFactory : ICommandsFactory
    {
        private MovieTheaterDbContext dbContext;
        private readonly IModelsFactory factory;

        public CommandsFactory(MovieTheaterDbContext dbContext, IModelsFactory factory)
        {
            Guard.WhenArgument(dbContext, "dbContext").IsNull().Throw();
            Guard.WhenArgument(factory, "Models Factory").IsNull().Throw();

            this.dbContext = dbContext;
            this.factory = factory;
        }

        public ICommand CreateCommandFromString(string commandName)
        {
            string command = commandName.ToLower();
<commit_msg>change dbContext and ModelsFactory fields in CommandsFactory to readonly<commit_after>﻿using System;
using Bytes2you.Validation;
using MovieTheater.Data;
using MovieTheater.Framework.Core.Commands.Contracts;
using MovieTheater.Models.Factory.Contracts;

namespace MovieTheater.Framework.Core.Commands
{
    public class CommandsFactory : ICommandsFactory
    {
        private readonly MovieTheaterDbContext dbContext;
        private readonly IModelsFactory factory;

        public CommandsFactory(MovieTheaterDbContext dbContext, IModelsFactory factory)
        {
            Guard.WhenArgument(dbContext, "dbContext").IsNull().Throw();
            Guard.WhenArgument(factory, "Models Factory").IsNull().Throw();

            this.dbContext = dbContext;
            this.factory = factory;
        }

        public ICommand CreateCommandFromString(string commandName)
        {
            string command = commandName.ToLower();

{'fraction_non_alphanumeric': 0.07888888888888888, 'fraction_numerical': 0.0011111111111111111, 'mean_word_length': 3.3502415458937196, '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': '2561752', 'n_tokens_mistral': 449, 'n_tokens_neox': 447, 'n_words': 97}