public void ToDictionary_ContainsAllStructuralProperties_IfInstanceIsNotNull() { // Arrange EdmModel model = new EdmModel(); EdmEntityType entityType = new EdmEntityType("NS", "Name"); model.AddElement(entityType); model.SetAnnotationValue(entityType, new ClrTypeAnnotation(typeof(TestEntity))); entityType.AddStructuralProperty("SampleProperty", EdmPrimitiveTypeKind.Int32); IEdmTypeReference edmType = new EdmEntityTypeReference(entityType, isNullable: false); SelectExpandWrapper <TestEntity> testWrapper = new SelectExpandWrapper <TestEntity> { Instance = new TestEntity { SampleProperty = 42 }, ModelID = ModelContainer.GetModelID(model) }; // Act var result = testWrapper.ToDictionary(); // Assert Assert.Equal(42, result["SampleProperty"]); }
public void Property_Instance_RoundTrips() { SelectExpandWrapper <TestEntity> wrapper = new SelectExpandWrapper <TestEntity>(); Assert.Reflection.Property(wrapper, w => w.Instance, expectedDefaultValue: null, allowNull: true, roundTripTestValue: new TestEntity()); }