private static void Test_create_copies_value <T>(FacetDescription description, T value)
        {
            var facet = Facet.Create(description, value: value);

            var values = FacetValues.Create(new List <Facet> {
                facet
            });

            Facet returnedFacet = null;

            Assert.True(values.TryGetFacet(description, out returnedFacet));
            Assert.Equal(facet.Value, returnedFacet.Value);
        }
        public void Create_copies_value_from_ConcurrencyModeFacet()
        {
            var description = new FacetDescription(
                EdmProviderManifest.ConcurrencyModeFacetName, new EnumType(typeof(ConcurrencyMode)), null, null, null);
            var facet = Facet.Create(description, value: ConcurrencyMode.Fixed);

            var values = FacetValues.Create(new List <Facet> {
                facet
            });

            Facet returnedFacet = null;

            Assert.True(values.TryGetFacet(description, out returnedFacet));
            Assert.Equal(facet.Value, returnedFacet.Value);
        }
        public void Create_copies_value_from_StoreGeneratedPatternFacet()
        {
            var description = new FacetDescription(
                EdmProviderManifest.StoreGeneratedPatternFacetName, new EnumType(typeof(StoreGeneratedPattern)), null, null, null);
            var facet = Facet.Create(description, value: StoreGeneratedPattern.Computed);

            var values = FacetValues.Create(new List <Facet> {
                facet
            });

            Facet returnedFacet = null;

            Assert.True(values.TryGetFacet(description, out returnedFacet));
            Assert.Equal(facet.Value, returnedFacet.Value);
        }
        public void Create_copies_value_from_PrecisionFacet()
        {
            var description = new FacetDescription(
                DbProviderManifest.PrecisionFacetName, new PrimitiveType {
                PrimitiveTypeKind = PrimitiveTypeKind.Byte
            }, null, null, null);
            var facet = Facet.Create(description, value: (byte)1);

            var values = FacetValues.Create(new List <Facet> {
                facet
            });

            Facet returnedFacet = null;

            Assert.True(values.TryGetFacet(description, out returnedFacet));
            Assert.Equal(facet.Value, returnedFacet.Value);
        }