private bool CheckNullForEntities(EntityItemSimpleBaseType valueOfFieldItemType, EntitySimpleBaseType valueOfFieldStateType) { return (valueOfFieldItemType == null) && (valueOfFieldStateType == null); }
private bool Compare(EntityItemSimpleBaseType valueOfFieldItemType, EntitySimpleBaseType valueOfFieldStateType) { string itemValue = valueOfFieldItemType.Value; string stateValue = valueOfFieldStateType.Value; if ((itemValue == null) && (stateValue == null)) return true; // If one of objects to compare is null and another one is not null the compare result must be false. if (this.IsOneOfTheseObjectsNullAndAnotherOneNotNull(itemValue, stateValue) && string.IsNullOrEmpty(valueOfFieldStateType.var_ref)) return false; var value = valueOfFieldStateType.Value; if (IsThereDefinedVariable(valueOfFieldStateType)) value = ProcessVariableById(valueOfFieldStateType.var_ref); IOvalComparator comparator = new OvalComparatorFactory().GetComparator(valueOfFieldStateType.datatype); string firstElement = itemValue; string secondElement = value; return comparator.Compare(firstElement, secondElement, valueOfFieldStateType.operation); }
public void SetGroupEntityStatus(EntityItemSimpleBaseType groupNameEntity, StatusEnumeration status) { groupNameEntity.status = status; if ((status == StatusEnumeration.doesnotexist) || (status == StatusEnumeration.error)) groupNameEntity.Value = string.Empty; }
private bool CheckDoesNotExistStatusForEntity(EntityItemSimpleBaseType entityItem) { return ((entityItem != null) && (string.IsNullOrEmpty(entityItem.Value)) && (entityItem.status == StatusEnumeration.doesnotexist)); }
private void AssertItemTypeEntity(EntityItemSimpleBaseType entityToAssert, string expectedEntityVale) { Assert.IsNotNull(entityToAssert); Assert.IsFalse(string.IsNullOrEmpty(entityToAssert.Value)); Assert.AreEqual(expectedEntityVale, entityToAssert.Value); }
private void AssertRegistryEntityItem(EntityItemSimpleBaseType entityToAssert, string expectedEntityValue) { Assert.IsNotNull(entityToAssert); Assert.AreEqual(StatusEnumeration.exists, entityToAssert.status); Assert.AreEqual(expectedEntityValue, entityToAssert.Value); }
private void AssertMetabaseEntity(EntityItemSimpleBaseType entityToAssert, string expectedEntityValue) { Assert.IsNotNull(entityToAssert, "A null metabase entity was found."); Assert.AreEqual(expectedEntityValue, entityToAssert.Value, "An unexpected entity value was found.."); }
protected void SetEntityStatus(EntityItemSimpleBaseType entity, StatusEnumeration status) { entity.status = status; }
/// <summary> /// It checks the entity item value. /// </summary> /// <param name="entityToAssert">Item entity to assert.</param> /// <param name="expectedValue">Expected entity item value.</param> public static void AssertItemTypeEntity(EntityItemSimpleBaseType entityToAssert, string expectedValue, string entityName = "") { Assert.IsNotNull(entityToAssert, "The '{0}' entity cannot be null.", entityName); Assert.IsNotNull(entityToAssert.Value, "The '{0}' entity value cannot be null", entityName); Assert.AreEqual(expectedValue, entityToAssert.Value, "Unexpected value was found for '{0}' entity.", entityName); }
private void AssertEnvironmentVariableItemEntity(EntityItemSimpleBaseType entityToAssert, string expectedValue) { Assert.IsNotNull(entityToAssert); Assert.IsFalse(string.IsNullOrEmpty(entityToAssert.Value)); Assert.AreEqual(entityToAssert.Value, expectedValue); }
private bool IsItemEntityDefined(EntityItemSimpleBaseType itemEntity) { return ((itemEntity != null) && (!string.IsNullOrEmpty(itemEntity.Value))); }