public void Should_be_possible_to_create_a_instance_of_EntityBaseType_based_on_another_EntityBaseType() { EntityObjectStringType entitySource = new EntityObjectStringType() { datatype = Common.SimpleDatatypeEnumeration.@string, operation = Common.OperationEnumeration.equals, Value = "file.txt" }; EntityBaseTypeFactory factory = new EntityBaseTypeFactory(); EntityObjectStringType newEntity = factory.CreateEntityBasedOn <EntityObjectStringType>(entitySource); Assert.IsNotNull(newEntity); Assert.IsInstanceOfType(newEntity, typeof(EntityObjectStringType)); Assert.AreEqual(Common.SimpleDatatypeEnumeration.@string, newEntity.datatype); Assert.AreEqual(Common.OperationEnumeration.equals, newEntity.operation); Assert.AreEqual("file.txt", newEntity.Value); EntityObjectBoolType entityBoolSource = new EntityObjectBoolType() { datatype = Common.SimpleDatatypeEnumeration.boolean, operation = Common.OperationEnumeration.notequal, var_ref = "oval:modulo:19" }; EntityObjectBoolType newEntityBoolType = factory.CreateEntityBasedOn <EntityObjectBoolType>(entityBoolSource); Assert.IsNotNull(newEntityBoolType); Assert.IsInstanceOfType(newEntityBoolType, typeof(EntityObjectBoolType)); }
public void Should_be_possible_to_create_a_instance_of_EntityBaseType_based_on_another_EntityBaseType() { EntityObjectStringType entitySource = new EntityObjectStringType() { datatype = Common.SimpleDatatypeEnumeration.@string, operation = Common.OperationEnumeration.equals, Value = "file.txt" }; EntityBaseTypeFactory factory = new EntityBaseTypeFactory(); EntityObjectStringType newEntity = factory.CreateEntityBasedOn<EntityObjectStringType>(entitySource); Assert.IsNotNull(newEntity); Assert.IsInstanceOfType(newEntity,typeof(EntityObjectStringType)); Assert.AreEqual(Common.SimpleDatatypeEnumeration.@string, newEntity.datatype); Assert.AreEqual(Common.OperationEnumeration.equals, newEntity.operation); Assert.AreEqual("file.txt", newEntity.Value); EntityObjectBoolType entityBoolSource = new EntityObjectBoolType() { datatype = Common.SimpleDatatypeEnumeration.boolean, operation = Common.OperationEnumeration.notequal, var_ref = "oval:modulo:19" }; EntityObjectBoolType newEntityBoolType = factory.CreateEntityBasedOn<EntityObjectBoolType>(entityBoolSource); Assert.IsNotNull(newEntityBoolType); Assert.IsInstanceOfType(newEntityBoolType, typeof(EntityObjectBoolType)); }