public void Should_be_possible_to_process_entity_that_contains_a_reference_to_a_variable()
        {
            var fileContentObject2000 = this.GetFileContentObjectToTest(DEFINITIONS_WITH_CONST_VARIABLES, "2000");
            var fakeVariablesValues   = new Dictionary <string, IEnumerable <string> >();

            fakeVariablesValues.Add(VAR_2001_ID_PATH, new string[] { "c:\\temp" });
            fakeVariablesValues.Add(VAR_2002_ID_FILENAME, new string[] { "test.txt" });
            fakeVariablesValues.Add(VAR_2003_ID_LINE, new string[] { "test" });
            var fakeEvaluatedVariables = VariableHelper.CreateEvaluatedVariables(fileContentObject2000.id, fakeVariablesValues);

            var fileContentVariableEvaluator   = new FileContentEntityVariableEvaluator(fakeEvaluatedVariables);
            IEnumerable <ObjectType> variables = fileContentVariableEvaluator.ProcessVariables(fileContentObject2000);

            Assert.IsNotNull(variables);
            Assert.AreEqual(1, variables.Count(), UNEXPECTED_AMOUNT_OF_ENTITIES);
            var fileContentObject = (textfilecontent_object)variables.First();

            var path = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.path);

            Assert.AreEqual(@"c:\temp", path.Value, INVALID_VARIABLE_VALUE_FOUND);

            var line = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.line);

            Assert.AreEqual("test", line.Value, INVALID_VARIABLE_VALUE_FOUND);

            var fileName = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.filename);

            Assert.AreEqual("test.txt", fileName.Value, INVALID_VARIABLE_VALUE_FOUND);
        }
        public void Should_be_possible_to_process_fileName_entity_that_contains_a_reference_to_a_variable_with_multi_values()
        {
            var fileContentObject2000 = this.GetFileContentObjectToTest(DEFINITIONS_WITH_CONST_VARIABLES, "2000");
            var fakeVariablesValues   = new Dictionary <string, IEnumerable <string> >();

            fakeVariablesValues.Add(VAR_2002_ID_FILENAME, new string[] { "file1.txt", "file2.txt", "file3.txt" });

            var fakeEvaluatedVariables         = VariableHelper.CreateEvaluatedVariables(fileContentObject2000.id, fakeVariablesValues);
            var fileContentVariableEvaluator   = new FileContentEntityVariableEvaluator(fakeEvaluatedVariables);
            IEnumerable <ObjectType> variables = fileContentVariableEvaluator.ProcessVariables(fileContentObject2000);

            Assert.IsNotNull(variables);
            Assert.AreEqual(3, variables.Count(), UNEXPECTED_AMOUNT_OF_ENTITIES);

            var fileContentObject = (textfilecontent_object)variables.ElementAt(0);
            var fileName          = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.filename);

            Assert.AreEqual(@"file1.txt", fileName.Value, INVALID_VARIABLE_VALUE_FOUND);

            fileContentObject = (textfilecontent_object)variables.ElementAt(1);
            fileName          = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.filename);
            Assert.AreEqual(@"file2.txt", fileName.Value, INVALID_VARIABLE_VALUE_FOUND);

            fileContentObject = (textfilecontent_object)variables.ElementAt(2);
            fileName          = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.filename);
            Assert.AreEqual(@"file3.txt", fileName.Value, INVALID_VARIABLE_VALUE_FOUND);
        }
        public void Should_be_possible_to_process_path_entity_that_contains_a_reference_to_a_variable_with_multi_values()
        {
            var fileContentObject2000 = this.GetFileContentObjectToTest(DEFINITIONS_WITH_CONST_VARIABLES, "2000");

            var fakeVariablesValues = new Dictionary <string, IEnumerable <string> >();

            fakeVariablesValues.Add(VAR_2001_ID_PATH, new string[] { "c:\\temp", "c:\\Windows" });

            var fakeEvaluatedVariables       = VariableHelper.CreateEvaluatedVariables(fileContentObject2000.id, fakeVariablesValues);
            var fileContentVariableEvaluator = new FileContentEntityVariableEvaluator(fakeEvaluatedVariables);
            var variables = fileContentVariableEvaluator.ProcessVariables(fileContentObject2000);

            Assert.IsNotNull(variables);
            Assert.AreEqual(2, variables.Count(), UNEXPECTED_AMOUNT_OF_ENTITIES);

            var fileContentObject = (textfilecontent_object)variables.ElementAt(0);
            var path = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.path);

            Assert.AreEqual(@"c:\temp", path.Value, INVALID_VARIABLE_VALUE_FOUND);

            fileContentObject = (textfilecontent_object)variables.ElementAt(1);
            path = (EntityObjectStringType)fileContentObject.GetItemValue(textfilecontent_ItemsChoices.path);
            Assert.AreEqual(@"c:\Windows", path.Value, INVALID_VARIABLE_VALUE_FOUND);
        }