public void Should_be_possible_to_generate_items_to_collect_from_a_sql_object_with_referenced_variable_on_engine_entity() { var fakeVariables = VariableHelper.CreateVariableWithOneValue("5010", "5010", "oracle"); var fakeObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple", "5010"); var itemsToCollect = new SqlItemTypeGenerator().GetItemsToCollect(fakeObject, fakeVariables); AssertSqlItem((sql_item)itemsToCollect.Single()); }
public void Should_be_possible_to_generate_items_to_collect_from_a_sql_object() { var fakeObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple", "5000"); var itemsToCollect = new SqlItemTypeGenerator().GetItemsToCollect(fakeObject, VariableHelper.CreateEmptyEvaluatedVariables()); Assert.IsNotNull(itemsToCollect); ItemTypeChecker.DoBasicAssertForItems(itemsToCollect.ToArray(), 1, typeof(sql_item)); AssertSqlItem((sql_item)itemsToCollect.Single()); }
public void Should_be_possible_to_generate_items_to_collect_from_a_sql_object_with_referenced_variable_in_all_entities() { var fakeVariableValues = CreateFakeVariableValues(); var fakeVariables = VariableHelper.CreateEvaluatedVariables("oval:modulo:obj:5050", fakeVariableValues); var fakeObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple", "5050"); var itemsToCollect = new SqlItemTypeGenerator().GetItemsToCollect(fakeObject, fakeVariables); Assert.AreEqual(1, itemsToCollect.Count()); AssertSqlItem((sql_item)itemsToCollect.Single(), "postgres", "8", FAKE_CONNECTION_STRING2, FAKE_SQL_QUERY2); }