public void CtorThatTakesEntityTypeConfiguration_Sets_Property_EntityType()
        {
            // Arrange
            ODataModelBuilder builder = new ODataModelBuilder();
            EntityTypeConfiguration entityType = new EntityTypeConfiguration(new ODataModelBuilder(), typeof(SingletonConfigurationTest));

            // Act
            SingletonConfiguration singleton = new SingletonConfiguration(builder, entityType, "singleton");

            // Assert
            Assert.Equal(entityType, singleton.EntityType);
        }
        public void CtorThatTakesClrType_Sets_Property_EntityType()
        {
            // Arrange
            ODataModelBuilder builder = new ODataModelBuilder();

            // Act
            SingletonConfiguration singleton = new SingletonConfiguration(builder, typeof(SingletonConfigurationTest), "singleton");

            // Assert
            Assert.NotNull(singleton.EntityType);
            Assert.Equal(typeof(SingletonConfigurationTest), singleton.EntityType.ClrType);
        }
        public void CtorThatTakesClrType_Sets_Property_Name()
        {
            // Arrange
            ODataModelBuilder builder = new ODataModelBuilder();

            // Act
            SingletonConfiguration singleton = new SingletonConfiguration(builder, typeof(SingletonConfigurationTest), "singleton");

            // Assert
            Assert.Equal("singleton", singleton.Name);
        }
 public SingletonConfigurationTest()
 {
     _builder = new ODataModelBuilder();
     _singleton = new SingletonConfiguration(_builder, typeof(SingletonConfigurationTest), "singleton");
 }
Пример #5
0
 private static EdmSingleton AddSingleton(this EdmEntityContainer container, SingletonConfiguration singletonType, IDictionary<Type, IEdmType> edmTypeMap)
 {
     return container.AddSingleton(singletonType.Name, (IEdmEntityType)edmTypeMap[singletonType.EntityType.ClrType]);
 }
Пример #6
0
 private static EdmSingleton AddSingleton(this EdmEntityContainer container, SingletonConfiguration singletonType, IDictionary <Type, IEdmType> edmTypeMap)
 {
     return(container.AddSingleton(singletonType.Name, (IEdmEntityType)edmTypeMap[singletonType.EntityType.ClrType]));
 }
 public SingletonConfigurationTest()
 {
     _builder   = new ODataModelBuilder();
     _singleton = new SingletonConfiguration(_builder, typeof(SingletonConfigurationTest), "singleton");
 }